Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit f729d2e

Browse files
author
Paul Catinean
committed
Merge branch '12.0-product-load-time-bizz-shs' into '12.0'
[IMP][3118]inherit _get_possible_combinations and return empty object in case of config product See merge request pledra/odoo-product-configurator!73
2 parents 6d0db3d + 6a42190 commit f729d2e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

product_configurator/models/product.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ def write(self, vals):
330330

331331
return super(ProductTemplate, self).write(vals)
332332

333+
@api.multi
334+
def _get_possible_combinations(self, parent_combination=None,
335+
necessary_values=None):
336+
self.ensure_one()
337+
if not self.active:
338+
return _(
339+
"The product template is archived so no "
340+
"combination is possible."
341+
)
342+
if not self.config_ok:
343+
return super(ProductTemplate, self)._get_possible_combinations(
344+
parent_combination=parent_combination,
345+
necessary_values=necessary_values
346+
)
347+
return iter([self.env['product.template.attribute.value']])
348+
333349

334350
class ProductProduct(models.Model):
335351
_inherit = 'product.product'

0 commit comments

Comments
 (0)