Adding notes to order items in restaurant POS - odoo-9

Is there a way to add special instructions or to add a note to restaurant POS orders, like select a pizza, and add a note saying 'no broccoli'?
Can't find an option to do that; there seems to be only one search result listing a module which does this for an older version on odoo, but I'm sure many people have such a requirement.

I found the 'orderline notes' in the 'Restaurant & Bar' section of the POS settings. That does what I need.

Related

Number of restaurants with specific cuisine in each country

I am trying to figure out how many restaurants, in each country, there are of a specific cuisine (seafood). I have looked at Google Places Api and TripAdvisor Api, but cannot find these numbers. I donĀ“t need the list of restaurants, only number of restaurants. I found OpenStreetMap which looked very promising. I downloaded data for Norway, but the numbers are not correct (osmium tags-filter norway-latest.osm.pbf cuisine=seafood) = 62, which is way to low.
Any suggestion for how and where I can find what I am looking for?
Extrapolate.
You won't get an accurate answer, how do you even define what a seafood restaurant is?
Find out roughly how many restaurants there are in the area you are interested in and then decide what % of them might be seafood restaurants.
You can use this approach to extract the data from OpenStreetMap:
https://gis.stackexchange.com/questions/363474/aggregate-number-of-features-by-country-in-overpass
You can run the query on http://overpass-turbo.eu/ (go to settings and chose the kumi-systems server).
The query could look like this:
// Define fields for csv output
[out:csv(name, total)][timeout:2500];
//All countries
area["admin_level"=2];
// Count in each area
foreach->.regio(
// Collect all Nodes with highway=milestone in the current area
( node(area.regio)[cuisine=seafood];
way(area.regio)[cuisine=seafood];
rel(area.regio)[cuisine=seafood];);
// assemble the output
make count name = regio.set(t["name:en"]),
total = count(nodes) + count(ways) + count(relations);
out;
);
This query can take a long time (at the time of writing, mine did not yet finish)
You can also run the query via curl in on some server and let the results mailed to you via curl ....... | mail -s "Overpass Result" yourmail#example.com. You get the curl command in the browser network tab by "copy curl"
I also considered Taginfo (https://taginfo.openstreetmap.org/tags/cuisine=seafood) but it cannot filter by tag.

Plone: generic search form for portal_catalog

I have a few Plone sites with Archetypes-based contents.
I noticed that the vanilla portal_catalog search form (manage_catalogView) allows to filter by language, portal_type (one!) and path only - since these are always available.
Thus, whenever I need a quick search by any other criteria, this involves programming, e.g. writing a throw-away Script (Python).
Is there some extension which provides a generic search form, offering all configured search indexes? E.g.:
Search for IDs
Search for Creator
Search for creation time (two fields, for min and max; one of them or both could be used)
review state (use the distinct values for selectable choices)
...
Perhaps I missunderstood your question, but you don't need external methods for a catalog search or a custom extension.
You can use a python script object and call it right from url.
Go to ZMI root, add a Script(python) using the selection field in the upper right corner. Give an id and delete the example content.
Use the examples for queryCatalog or searchCatalog you will find in http://docs.plone.org/develop/plone/searching_and_indexing/query.html
and call your script using the TEST Tab or form URL.
Example:
In ZMI Root Folder, I created a python script called my_test
catalog = context.portal_catalog
from DateTime import DateTime
# DateTime deltas are days as floating points
end = DateTime() + 0.1
start = DateTime() - 1
date_range_query = { 'query':(start,end), 'range': 'min:max'}
query = {'id': ['id_1', 'id_2'],
'Creator': ['creator1', 'creator2'],
'created': date_range_query,
'review_state': ['published', 'pending']}
results = catalog.queryCatalog(query)
for brain in results:
print brain.pretty_title_or_id()
return printed
Finally, if you set some parameters into your python script you can also pass them through URL or the TEST tab.
Hope it helps you

Joomla K2 content sort by number of votes

I'm using Joomla 2.5 and K2 2.5.7. I have a category with posts with a different number of votes. In the front end, I need to sort the items of this category by number of votes.
I re-configured standard stars rating systems to simple "Give one vote" system.
I need this for a ranking order page, so it will have items with the largest number of votes on the top.
What I have
I have my MVC template for K2 category. I was wondering, if sorting $this->leading in category.php is the right to go for.
If it is, how can I do it? With var_dump there is variable numOfVotes which carry real number of votes. How can I sort this object by this var?
Thank you very much!
This K2 forum post seems to answer your question. You need to use the mod_content k2 module and use the "sort by" parameter and select highest rating.
If you go to 'modules/mod_k2_content/helper.php' in the ftp, you'll see on line 98, that there it says
$query .= ", (r.rating_sum/r.rating_count) AS rating";
This sorts the data by the highest rating. Now generally this would sort it by the number of votes divided by the number of people who have voted giving a result between 1 and 5. However as everyone in your case gets a vote of 5 - then your average result will always be 5 by that calculation!, I think that you'll have to replace that line with:
$query .= ", r.rating_count AS rating";
i.e. just sorting by the number of people who have voted (N.B. This assumes you're not using a vote down system as well! You haven't mentioned it so I'm assuming not)
Then you should just be able to use the module (selecting the parameter that you desire as normal)
For using the component category option etc. Then the same line of code can be found in 'components/com_k2/models/itemlist.php' on Line 39 which again would need to be edited. Then you could just use the built in parameters as usual!

LINQ - OR two SqlMethods.Like clauses

I need to OR two SqlMethods.Like statements in LINQ, and I'm not sure how to accomplish it (or if it's the right way to go about it).
I've got vendor ID and vendor name fields, but I've only got a generic vendor search that allows a user to search for a vendor based on their name or ID. I also allow wildcards in the search, so I need to find vendors whose ID or name is like the user's input.
I want to do something like below, but obviously it's not correct. (EDIT: It does work as written.)
results = results.Where(p => SqlMethods.Like(p.VendorId, inputVendor.Replace("*", "%") ||
SqlMethods.Like(p.VendorName, inputVendor.Replace("*", "%"));
Background: I add where statements depending on the search parameters entered by the user, hence the results = results.Where part.
Any help would be appreciated!
It's not clear to me why this is "obviously" not correct. Presumably it's not working, otherwise you wouldn't have posted, but it's not obvious how it's not working.
I would suggest performing the replacement before the query, like this:
string vendorPattern = inputVendor.Replace("*", "%");
But then I'd expect this to work:
results = results.Where(p => SqlMethods.Like(p.VendorId, vendorPattern) ||
SqlMethods.Like(p.VendorName, vendorPattern));
Of course you're limited to where wildcards can appear in a SQL LIKE query, but that's a separate problem. (I'm not sure of the behaviour offhand if it's not at the start or end.)
If that doesn't help, please update the question with what happens when you try this.

Magento Option Question

This seems simple enough in theory but I haven't found anything on it. I need it for a client. Please see this page as an example: http://www.customsportsteamuniforms.com/index.php/test-shirt.html
On that page, you will find the first option that says "What kind of Screen Printing do you want?" If you select 1 color and you also happen to want more than 1 quantity (let's say 5), you will end up with this formula for the product cost:
$5 (cost) x $25 (option) x 5 quantity = total.
I DO NOT want it to do that. The option should be a one time fee in this case. The formula should read:
$5 (cost) x 5 quantity = sub-total + $25 (option) = total
How do I do this?
Magento's additional fees are all calculated on a per-product basis. If you want to add a fee to the entire order, you'll need to add some custom code to add this as a sort of handling fee for the order. The semantics for this are up to you (for instance, what about 2 different shirts both with 1-color screen printing options).
I found a plugin that does this:
http://www.absolutepricing.com/
Although, in my opinion, this should have been part of the system to begin with, but that's neither here nor there...

Resources