[9.0][IMP] mrp_bom_dismantling: rename method

This commit is contained in:
lreficent
2017-04-26 11:32:07 +02:00
parent 30f7377214
commit da58a28c00
3 changed files with 5 additions and 5 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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.'))