diff --git a/product_classification/__manifest__.py b/product_classification/__manifest__.py index bb6e13dc..b74566c2 100644 --- a/product_classification/__manifest__.py +++ b/product_classification/__manifest__.py @@ -3,13 +3,14 @@ { 'name': 'Product Classification', - 'version': '11.0.1.1.0', + 'version': '11.0.1.2.0', 'license': 'AGPL-3', 'author': 'Noviat', 'website': 'http://www.noviat.com', 'category': 'Product Management', 'depends': [ 'product', + 'sale', ], 'data': [ 'security/ir.model.access.csv', diff --git a/product_classification/models/product_classification.py b/product_classification/models/product_classification.py index 756cf7e7..28a00725 100644 --- a/product_classification/models/product_classification.py +++ b/product_classification/models/product_classification.py @@ -57,3 +57,15 @@ def _get_complete_name(self, cl): else: parent_path = '' return parent_path + cl.name + + @api.multi + def get_product_tmpls_recursively(self): + """ + Returns all product.template records belonging to this + classification or its children. + """ + self.ensure_one() + res = self.product_tmpl_ids + for classif in self.child_ids: + res |= classif.get_product_tmpls_recursively() + return res