diff options
| author | Nasreddin (bon) <bon@odoo.com> | 2020-10-07 08:56:34 +0000 |
|---|---|---|
| committer | Nasreddin (bon) <bon@odoo.com> | 2020-10-08 08:00:14 +0000 |
| commit | 0474f9b6bb3c959a2fe4ad1b231fa5e8ffbcf9d8 (patch) | |
| tree | a3e68eb3cd3fb06431858d8c6bfe97a28083dcb2 /addons/pos_restaurant/static/src | |
| parent | c3524b1cdc63eae0d30d8f435e8bb9a541c88f06 (diff) | |
[FIX] pos_restaurant: Error when adding product after printing the bill
Issue
- Install "Point of sale"
- Create a new one.
- Activate the "Is a Bar/Restaurant" feature and save
- Activate the "Bill Printing" feature then save
- Start a new session
- Add a product A
- Click on "Bill" then "Print"
- Then click on "Ok" to go back to order
- Add a product B
Error is raised ("Cannot read property 'add_product' of null").
Cause
Trying to add a product to an order who is destroyed
if the bill has been printed.
Solution
If the bill is printed (and not the receipt), set '_printed' of
the current order to 'false', therefore it will add the product
to the current order.
opw-2341115
closes odoo/odoo#59461
X-original-commit: 6683a9929d68be956854000fa9b3e9f99ceecdfb
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Diffstat (limited to 'addons/pos_restaurant/static/src')
| -rw-r--r-- | addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js b/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js index 689c3bf40ca..3976eb4e270 100644 --- a/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js @@ -20,6 +20,13 @@ odoo.define('pos_restaurant.ReceiptScreen', function(require) { return super.nextScreen; } } + /** + * @override + */ + async _printWeb() { + await super._printWeb(); + this.currentOrder._printed = false; + } }; Registries.Component.extend(ReceiptScreen, PosResReceiptScreen); |
