From b706dbc29a4d7c0f8b6ab7907a5afda22ba5c3fe Mon Sep 17 00:00:00 2001 From: Renilkumar Kajavadra Date: Thu, 19 Oct 2023 12:10:09 +0530 Subject: [PATCH] [FIX] product: prevent traceback on removing quantity of product in quotation When user removes the quantity of product and tries to confirm the product in configure wizard, a traceback will appear. Steps to reproduce the error: - Go to Sales > Configuration > Settings > Product Catalog > enable Variant Grid Entry > Pricing > enable Pricelists (Advanced price rules) - Go to products > pricelist > open any pricelist > Add a line > set value of Min. Quantity - Create new Quotation > Select that pricelist > Add a product > Select a product that has variants (ex. Conference Chair) > In configure wizard, remove quantity > Confirm Error: A traceback appears: "TypeError: '<' not supported between instances of 'NoneType' and 'float' " https://github.com/odoo/odoo/blob/fe79e1b5fdc408d55bbb3ac11209163436c1fa2c/addons/product/models/product_pricelist_item.py#L319 Here, when user removes quantity of product, qty_in_product_uom will be None. So it will lead to above traceback. sentry-4547178082 closes odoo/odoo#141523 X-original-commit: 09ff54f1d90be5ef5f2e76deaa481f263c6c75c9 Signed-off-by: Victor Feyens (vfe) --- addons/sale_product_configurator/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_product_configurator/controllers/main.py b/addons/sale_product_configurator/controllers/main.py index 763c1e6dfaf..a56662b55c4 100644 --- a/addons/sale_product_configurator/controllers/main.py +++ b/addons/sale_product_configurator/controllers/main.py @@ -139,7 +139,7 @@ class ProductConfiguratorController(Controller): product or product_template, pricelist, combination, - quantity=quantity, + quantity=quantity or 0.0, uom=product_uom, currency=currency, date=datetime.fromisoformat(so_date),