From eb007f9d3b2cfc575f8ce9ceba6ca5ca7067ee24 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Tue, 19 Jul 2022 10:53:10 +0000 Subject: [PATCH] [FIX] point_of_sale: fix calling set_quantity_by_lot function There is a mistake in forward-port of this PR (8cfc2bdcadff72bee9400c8893677d35e551b92d) on version saas-15.2 (007e7e1563b89ebd2eef51e48303a5af1348d024). This is the traceback when using the lot number in PoS: TypeError: this.pack_lot_lines.set_quantity_by_lot is not afunction at Proxy.setPackLotLines (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1424:49) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1566:55) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:1772:36) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:2358:883) at Proxy.add_product (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:2749:359) at ProductScreen._clickProduct (https://17609393-saas-15-2-all.runbot70.odoo.com/web/assets/1996-322b17a/point_of_sale.assets.min.js:931:121) The currect format is "this.set_quantity_by_lot();", but it's "this.pack_lot_lines.set_quantity_by_lot();". opw-2919419 closes odoo/odoo#96354 X-original-commit: ff780738dd4675a52557275c8ffae94559217776 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Pedram Bi Ria (pebr) --- addons/point_of_sale/static/src/js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 89700c008cd..3781a73e4ff 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1489,7 +1489,7 @@ class Orderline extends PosModel { // Set the quantity of the line based on number of pack lots. if(!this.product.to_weight){ - this.pack_lot_lines.set_quantity_by_lot(); + this.set_quantity_by_lot(); } } set_product_lot(product){