summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-05-19 10:06:17 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-05-19 12:58:18 +0000
commitd1d523e4836195da6b081253f258a2653f35ded2 (patch)
tree365ae235fedf0b2e0a2e1b84c736991a1d8b8399
parent81ba7084aeb3899787d083a2a2568a490f9c53e5 (diff)
[FIX] sale_product_matrix: avoid traceback when using Order Grid Entry
- Enable 'product configurator' and 'variant grid entry' - Go to product [DEMO]: - Add an optional product. - Go to the variants tab and add some variants - Select 'order grid entry' - Remove all the variants - Create a SO adding [DEMO] Traceback will occur opw-2439764 closes odoo/odoo#71035 X-original-commit: da9541089fcf33c778748c4c3da0d81f6b5ea227 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
-rw-r--r--addons/sale_product_matrix/models/product_template.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/sale_product_matrix/models/product_template.py b/addons/sale_product_matrix/models/product_template.py
index 0ca6f2ef1e8..8440b5b3620 100644
--- a/addons/sale_product_matrix/models/product_template.py
+++ b/addons/sale_product_matrix/models/product_template.py
@@ -14,5 +14,8 @@ class ProductTemplate(models.Model):
def get_single_product_variant(self):
res = super(ProductTemplate, self).get_single_product_variant()
- res['mode'] = self.product_add_mode
+ if self.has_configurable_attributes:
+ res['mode'] = self.product_add_mode
+ else:
+ res['mode'] = 'configurator'
return res