In order to improve the self order user experience, QR code generation
has been improved. Now, the user can reset the access_token linked to
the QR code and then regenerate them, he can also redownload the QR code
whenever he wishes.
The content of the QR code PDF has also been changed. Now, for each
table a QR code is generated and inserted in the PDF with the name of
the table and its unique identifier (access_token).
closesodoo/odoo#129100
Taskid: 3377335
Related: odoo/upgrade#4958
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :
<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>
task-3292454
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
These changes are made as a result of simplifying attrs and 'states' in
views.
Before applying the migration script, it is necessary to fix some views.
These views are erroneous and either work by chance or are simply
untested. We have for example wrong domains, elements used by modifiers
but not present in the view, obsolete domain operators, inherit views
not targeting the right views, xpaths using attributes as target, the
use of %(...)s in views, false attribute value types in python.
Part-of: odoo/odoo#104741
before this commit, in the pos settings when the qr code
menu is activated, the buttons Generate QR Codes, Configure
Buttons, Preview is not aligned properly
after this commit, the button will be aligned properly
in the settings.
closesodoo/odoo#129095
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
before this commit, in the print action of pos.config
model, it is shown as qr.codes for printing the qr code
after this commit, the name will be updated QR Codes as
in the printed file name.
closesodoo/odoo#129088
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
**Steps to reproduce:**
- Install pos_self_order.
- Create a product with a price of any price, say 100.
- Assign a tax of 10% to the product.
- Create a new company and switch to it.
- With the same product, add a new tax, say 20%.
- Go back to the original company.
- Open a bar (restaurant pos.config) that allows self order which also loads the
product.
- Open self order page and add the product.
- [BUG] The product's price is not only 10%-taxed, but also 20%-taxed.
**Explanation and fix**
The issue is caused by use of sudo almost everywhere in the context of
pos_self_order. This commit removes/reduces this use of sudo in many places and
contextualize the records involved in the calculation such as pos.config,
product.product, etc. to be the ones of the company and the user who opened the
current pos.session.
After this changes, only the taxes that belong to the company of the pos.config
record are used in the price and tax calculations.
closesodoo/odoo#131140
X-original-commit: 7ce7f3e21ad8f457742e27f88b7146c7d8fff5f3
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Nothing will happen if you click on a product without image, sale comment
and attributes in selfOder if no table was selected before.
To reproduce the issue:
1. Create a product without image, sale comment and attributes (Fill in product name, price, availible in pos)
2. Open a new selfOrder page (without a table selected)
3. Click on the product
Issue: nothing happens, the product cannot be ordered. If no product meets
at least one of the three conditions (image, sale comment or attributes),
it will not be possible to select the table, and thus self-ordering will
be impossible. In fact the table selection only happens during the first
order.
closesodoo/odoo#130614
X-original-commit: 186d60e57da5a5b0182131a936838821a01a7a5f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
*: pos_self_order
Adds online payment support for self-order flow in the Point of Sale app.
- Adds a configurable online payment method specific to the self-order flow, which is optional in "Pay after meal" mode, required in "Pay after each" mode.
The POS config of a restaurant can use 2 different online payment methods, one for the frontend cashier flow, and another for the self-order flow, or can use the same for both.
By default, if an online payment method is configured for the self-order flow, any new order paid online will be paid with that payment method.
But if the cashier requests an online payment with a different online payment method, that payment method will be used for that order during the time the cashier keeps his online payment popup open (without cancelling the online payment) (after cancelling the online payment, the order could potentially still be paid online, and if so it will use the online payment method of the self-order if one is configured, otherwise the online payment method of the cashier flow).
- Allows the customer to open the online payment page of an order from the self-order UI.
In "Pay after meal" mode, if an online payment method is configured, the "Pay" button is displayed when the customer order is saved on the server, otherwise the "Order" button is displayed (even when the order has been sent to the server and then modified without sending it again).
Otherwise, if no online payment method is configured, the "Pay at cashier" unclickable button is displayed.
In "Pay after each" mode, the "Pay" button is displayed everytime.
- Replaces the self_order_after_each_cart_tour test.
closesodoo/odoo#127869
Task-id: 3171698
Related: odoo/enterprise#44055
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Previously, users could not cancel/delete their order once it had begun.
Only order lines not sent to the server could be deleted one by one.
Now, a "cancel" button has been added to the self shopping cart screen.
This button only appears when the order has not yet been sent to the
server. If the order has already been sent, it can only be cancelled
from a PoS.
closesodoo/odoo#128044
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.
In this commit,
the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.
Example :
registry.category("web_tour.tours").add("example", {
test: true,
steps: () => [
{...},
{...},
],
});
task-3292454
closesodoo/odoo#124157
Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
- Corrected incorrect use of access_token in an order.
- Correction of order change calculation in self_order.
closesodoo/odoo#125941
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
- Remove the notification and add a persistent banner at the top of the
screen when the restaurant is closed.
- Change the size of the product card to make it more compact and
smaller.
- Added a little shadow to the element fixed at the top and bottom.
- Corrected the alignment of price and quantity in the product list.
- In the card, the calculated price is now below the product list.
- The "add to cart" button is now dynamic, and will be
"remove from cart" if if the requested quantity is 0.
- Make the "my orders" button visible in meal mode and in each mode.
Part-of: odoo/odoo#125941
Purpose:
This commit adds Emoji_picker functionality to the web_editor,
allowing users to conveniently add emojis to their text and
improving the overall user experience.
Specifications:
Now we can insert emoji in web_editor using `/emoji`.
Task id: 3253958
closesodoo/odoo#125137
Related: odoo/enterprise#42772
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Previously, access_token were linked to tables. These tables were linked
to a floor_plan, which could be linked to several pos_configs.
The only way to access the self-order was to obtain a valid table
access_token. This behaviour was not correct because sometimes we would
allow table selection directly in the interface or commands without
a table.
Now, access_token is managed by pos_config. When a user has this token,
they can place commands and select the table they want if the option is
enabled.
closesodoo/odoo#126186
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Previously, when an order was paid for at the restaurant counter,
the self-orderer received no update that the order had
been paid for.
Now, if the customer self-order page is still open on their phone,
it will receive a notification via websocket that the order has been
paid for from the restaurant counter.The order will no longer be
editable.
In the event that they have already closed the self-order when paying
at the counter, the next time they return to this page. An RPC request
will be made with the access_token of the old order and the
states will be aligned.
closesodoo/odoo#125921
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
*: point_of_sale, pos_self_order
Changes:
- Adds a default restaurant with some default usual settings (with tips after payment if the company is in the United States) but no floor in the Point of Sale app. Makes pos_restaurant module auto installed with point_of_sale.
- Makes some restaurant settings enabled by default (only for restaurants).
- Adds loadable default demonstration data for onboarding (only when no real product is available in POS), specific to a restaurant. The default demonstration data for onboarding of point_of_sale and pos_restaurant are loaded together (if pos_restaurant is installed) to make it so an user that clicks to add demo data will have demo data for the default point of sale and also for the default restaurant (and the current restaurant if it is different than the default one). Makes the load demonstration data button visible when there is no product with a positive price available, because without that condition the tips (in restaurant) and discount were preventing the display of the button.
- Hides the Preparation Printers menu item if there is no POS config using the printers.
- Renames some labels.
Fixes:
- Adds checks to always set set_tip_after_payment to False if a point of sale is no longer a restaurant or if the tips are disabled. This is needed because the code of pos_restaurant seems to be written considering that set_tip_after_payment is True only when the point of sale is a restaurant with the tips enabled (which wasn't guaranteed). Without that checks, some tests like ReceiptScreenTour fail. Another solution to make the tests successful without that checks would be to add !this.env.pos.config.module_pos_restaurant in pos_restaurant/static/src/js/Screens/PaymentScreen.js:16. But because other parts of the code only check the value of set_tip_after_payment, I think it is better to opt for the additionnal checks.
- Fixes duplication of displayed product categories when loading demonstration data.
- Fixes products before loading demonstration data that were kept and displayed after (discount for example).
- Fixes categories and therefore communication with the preparation display after loading demo data in a restaurant.
- Adds a check on the server side to prevent demonstration data loading when there is at least one valid product for POS.
- Fixes order count display when "NaN" (in floors and tables view).
- Fixes arguments of orm call for set_not_tip (model and method names were not given in the right order).
closesodoo/odoo#117941
Task-id: 2484291
Related: odoo/enterprise#39450
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
After this commit, underscore library is totally removed.
Library calls has been removed from manifests.
Library files has been deleted.
This commit closed the task below.
task-3246238
closesodoo/odoo#125889
Related: odoo/design-themes#662
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Correction of the order in which categories are displayed in the self
following the deletion of the "order" argument on the product search
in a previous PR.
closesodoo/odoo#125743
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Improvement of several aspects of the self-order UX:
- Changed the sentence indicating that the self-order is menu only.
- Added a shadow to the header.
- Reduced the size of the product image in the product list.
- Reduced the size of the product title in the product list.
- Reduced the size of the product image when you are on the page to add
it to the shopping basket.
- Added a shadow above the sticky area on a product's main page.
- The quantity of a product already added to the basket has been moved
from next to the title to next to the price.
- The review button now floats above the product list and no longer has
a background colour.
- In the basket, taxes and the total are now displayed after
orderlines and no longer sticky at the bottom.
- When the quantity of a product in the cart is changed to 0, the button
is now called "remove from cart".
Part-of: odoo/odoo#125743
Previously in the front-end there was a notion of "tag" which used
product categories. This led to misunderstandings, because in the
backend there was a notion of tag and category for the products.
Now, the name of the category field is aligned in the backend and
the frontend.
The product model ID field has also been changed from product_id to
id during loading.
Part-of: odoo/odoo#125743
Here is the list of bugs that have been fixed:
- Search, when you click on the search button, the input isn't
autofocused.
- The tag list now scrolls automatically so that the selected tag is
always visible on the screen.
- The back button did not work when the self was opened from a page
containing the back button. This is because we are using the browser
history. In this case, when the user clicks back, we send them to
the home page.
- Automatic tag selection during scrolling has been improved.
Part-of: odoo/odoo#125743
Currently, a product can only be part of one `pos_category`.
This PR changes the relationship between the `product` and the `pos_category` from a `One2many` to a `Many2many`.
closesodoo/odoo#122907
Task: 3138825
Related: odoo/enterprise#41791
Related: odoo/upgrade#4739
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
General refactoring of the codebase. Inline of certain components
that had no logic in the JS side, the XML of these components was
directly added to the place where they were called.
Simplification of the python controller, inline of many functions and
separation of the logic. There is now one function that manages new
orders and another that manages and updates existing orders if we are
in "pay after meal" mode. In "pay after each" mode, orders cannot be
edited.
Addition of different models, product, order and orderlines in order to
facilitate the use of these objects between the backend and the
frontend.
Added price calculation on the serverside because we can't trust the
data coming from the customer in the self since no identification
is required.
Management of last change sent added. Thanks to this, users will no
longer be able to click on the order button if no changes have been
made to the order.
closesodoo/odoo#122901
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
This commit adds a new module in web that contains a few helpers to
make it easier to use reactive in Odoo.
closesodoo/odoo#125136
Related: odoo/enterprise#42588
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
*: l10n_fr_pos_cert, pos_discount, pos_loyalty, pos_sale, pos_self_order
The `Orderline` model contains the fields: `price_manually_set` and `price_automatically_set`.
They are meant to signify what type of price the orderline has: `automatic`, `manual` or `original`.
It's very confusing to manage the two fields when in fact they only describe three types of setting the orderline price.
This PR replaces the 2 fields with a single one: `price_type`, which will take one of the 3 possible values.
closesodoo/odoo#124858
Task: 3358265
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
This PR aims to fix some small styling issues from the pos_self_order app.
closesodoo/odoo#122502
Signed-off-by: Guilliams Adrien (adgu) <adgu@odoo.com>
This PR adds the arrow icons to buttons in the QR Code menu settings in the interest of making the styling more uniform with the rest of the page.
closesodoo/odoo#122488
Closes: 3339325
Signed-off-by: Guilliams Adrien (adgu) <adgu@odoo.com>
The buttons for the QR Code Menu setting are quite unappealing. This PR changes their style.
Closes 3338270
closesodoo/odoo#122301
Signed-off-by: Monnom David (moda) <moda@odoo.com>
Currently from the pos_self_order app a customer can only view the menu.
This PR adds the option to order items.
A customer of the restaurant will now be able to scan a qr code on their table, and navigate to a website where they will be able to order items from the pos.
The customer can select product variants and add a specific notes for each of the ordered products.
This version does not support online payment. This means that the customer will still have to pay by the usual methods.
The pos can be configured such that a customer can add items to an existing order. For example, ordering a second coffee will result in an update of the existing pos order containing the first coffee. Alternatively, the pos can be configured such that each order made from the web app results in a new pos order. Orders made from the self order app will be placed in the same pos session as regular orders. Once a customer orders from the self order app, a new order will appear in the pos app. Thus, a waiter will be able to quickly see all the orders placed by customers from the self order app. He/She will then be able to send the order to the preparation display. This step has to be done manually.
In the interest of security, each table now has an associated access token. It is included in url that the customer gets from the qr code. When sending the order, the self order app also sends back to the server this access token. The server will only process the order if it receives a valid access token. When placing an order, the server will respond with the pos_reference and access_token of the created order. The web app will keep this data and will send it back to the
server as a proof of ownership in the event that it intends to get the latest state of the order or to update it. The server will only reveal information about an existing order when the request contains a valid pair of pos_reference and access_token.
closesodoo/odoo#121029
Task: 3058586
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.
task-2818586
Part-of: odoo/odoo#116641
Enable floor plan for all PoS Restaurant config. To accomplish this, we are
removing the following fields:
- `pos.config.is_table_management`
- `res.config.settings.pos_is_table_management`.
All access to `is_table_management` can be replaced by `module_pos_restaurant`
because originally, `is_table_management` can only be true if
`module_pos_restaurant` is true.
To adapt the tests, we should manually set `module_pos_restaurant` to `False` for
the `pos.config` used in tests outside `pos_restaurant` addon. This is because
when pos_restaurant addon is installed, it sets every new `pos.config` record to
be restaurant by default.
Task-3282975
closesodoo/odoo#120117
Related: odoo/enterprise#40532
Related: odoo/upgrade#4622
Signed-off-by: Monnom David (moda) <moda@odoo.com>
New module that would allow restaurant customers to see the menu on their own devices by scanning a qr code and navigating to the provided link.
Task id 3232765
closesodoo/odoo#114022
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>