We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efdce63 commit ce572bcCopy full SHA for ce572bc
pos_container_deposit/static/src/js/models.js
@@ -40,7 +40,14 @@ odoo.define("pos_container_deposit.models", function (require) {
40
* When adding a product with container deposit, add its container deposit product
41
**/
42
super.add_orderline(...arguments);
43
- if (line.container_deposit_product && !line.container_deposit_line) {
+ // Get unpayed orders orders from db.pos
44
+ const all_unpaid = this.pos.get_order_list().map((x) => x.cid);
45
+ const is_unpaid = all_unpaid.includes(line.order.cid);
46
+ if (
47
+ line.container_deposit_product &&
48
+ !line.container_deposit_line &&
49
+ is_unpaid
50
+ ) {
51
this.add_product(line.container_deposit_product, {
52
quantity: line.get_quantity(),
53
});
0 commit comments