nie afda1c359c [FIX] point_of_sale: reload order with negative price
Steps:
- Go to Point of Sale
- Open a new session
- Add an item to the cart
- Click [+/-], [1] to get a negative price
- Reload the page
- Click Payment
- Click Cash
- Validate
- Close the UI and go back to the backend
- Click the three dots on the POS
- Click View / Orders
- Open the last order

Bug:
The order is still in "New" state and two payments of the same amount
have been registered. This results in the order not being fully paid.

Explanation:
`get_change()` returns the amount to be given back to the customer. It's
usually set back to 0 when the payment lines are created (e.g. when
clicking "Cash"). `amount_return` is then sent to the backend with the
order.
However, when reloading the page before clicking "Cash", no payment
lines are made and `amount_return` has been saved in LocalStorage with
the result of `get_change()`. `amount_return`, which is usually
undefined is now set back to its old value when reloading from the saved
JSON.
Because `amount_return` is not undefined in this case, it doesn't change
the result sent in the JSON when clicking "Cash"; it's not updated with
0 from `get_change()`. This results in two payments being recorded in
the order after validating and sending it to the backend.

This commit always uses the result of `get_change()` when sending the
order to the backend.

opw:2446563

closes odoo/odoo#71757

X-original-commit: 5d1640d05442613963426adc1d83fe066480c1a4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-04 13:59:57 +00:00
…
…
…
…
2021-05-17 19:26:27 +00:00
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%