diff --git a/mrp_bom_dismantling/models/mrp_bom.py b/mrp_bom_dismantling/models/mrp_bom.py index 8a7792224..002a31de4 100644 --- a/mrp_bom_dismantling/models/mrp_bom.py +++ b/mrp_bom_dismantling/models/mrp_bom.py @@ -74,7 +74,7 @@ class MrpBom(models.Model): self._check_bom_validity(check_dismantling=True) product = self._get_bom_product() - components = self._get_components_needs() + components = self._get_component_needs() # If no main component, take first sorted by Id if not main_component: @@ -143,14 +143,14 @@ class MrpBom(models.Model): if warning: raise exceptions.UserError(_(warning)) - def _get_components_needs(self): + def _get_component_needs(self): """ Return this BoM components and their needed qties. The result is like {component_1: 1, component_2: 5, ...} :rtype: dict(product_product, float) """ - components = self.product_id._get_components_needs( + components = self.product_id._get_component_needs( product=self.product_id, bom=self ) return dict(components) diff --git a/mrp_bom_dismantling/models/product_product.py b/mrp_bom_dismantling/models/product_product.py index 8d0051d12..ee723f6b9 100644 --- a/mrp_bom_dismantling/models/product_product.py +++ b/mrp_bom_dismantling/models/product_product.py @@ -20,7 +20,7 @@ class ProductProduct(models.Model): result['domain'] = [('dismantling', '=', False)] return result - def _get_components_needs(self, product, bom): + def _get_component_needs(self, product, bom): """ Return the needed qty of each compoments in the *bom* of *product*. :type product: product_product diff --git a/mrp_bom_dismantling/wizards/dismantling_product_choice.py b/mrp_bom_dismantling/wizards/dismantling_product_choice.py index 9249a6a34..21325f492 100644 --- a/mrp_bom_dismantling/wizards/dismantling_product_choice.py +++ b/mrp_bom_dismantling/wizards/dismantling_product_choice.py @@ -28,7 +28,7 @@ class DismantlingProductChoice(models.TransientModel): """ Update component_id domain to include only BOM components. """ component_ids = sorted( - [c.id for c in self.bom_id._get_components_needs()] + [c.id for c in self.bom_id._get_component_needs()] ) if not component_ids: raise UserError(_('This BoM does not have components.'))