From 8b228bd8bacfbd13f89af86d4583bd708e140762 Mon Sep 17 00:00:00 2001 From: Matteo Boscolo Date: Sat, 30 Sep 2023 10:03:05 +0200 Subject: [PATCH] remove commend and imp function description --- plm/models/product_product.py | 41 ++++++++++------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/plm/models/product_product.py b/plm/models/product_product.py index f1043ae5..2c6fa196 100755 --- a/plm/models/product_product.py +++ b/plm/models/product_product.py @@ -217,32 +217,6 @@ def _showStd(self): product_product_id.std_value3 = False # product_product_id.on_change_stdvalue() - - - # @api.onchange('std_description') - # def on_change_stddesc(self): - # if self.std_description: - # if self.std_description.description: - # self.name = self.std_description.description - # if self.std_description.umc1: - # self.std_umc1 = self.std_description.umc1 - # else: - # self.std_umc1="" - # self.std_value1=False - # if self.std_description.umc2: - # self.std_umc2 = self.std_description.umc2 - # else: - # self.std_umc2="" - # self.std_value2=False - # if self.std_description.umc3: - # self.std_umc3 = self.std_description.umc3 - # else: - # self.std_umc3="" - # self.std_value3=False - # if self.std_description.unitab: - # self.name = self.name + " " + self.std_description.unitab - - @api.onchange('std_value1', 'std_value2', 'std_value3', 'std_umc1','std_umc2','std_umc3') def on_change_stdvalue(self): @@ -439,20 +413,27 @@ def open_boms(self): } @api.model - def _getChildrenBom(self, component, level=0, currlevel=0, bom_type=False): + def _getChildrenBom(self, + product_product_id, + level=0, + currlevel=0, + bom_type=False): """ - Return a flat list of each child, listed once, in a Bom ( level = 0 one level only, level = 1 all levels) + Return a flat list of each child, listed once, in a Bom + :level = [ 0 one level only, 1 all levels] + :currlevel starting level for the bom + :bom_type type bom calculation """ result = [] bufferdata = [] if level <= currlevel and level > 0: return bufferdata - for bomid in component.product_tmpl_id.bom_ids: + for bomid in product_product_id.product_tmpl_id.bom_ids: if bom_type: if bomid.type != bom_type: continue for bomline in bomid.bom_line_ids: - children = self._getChildrenBom(component=bomline.product_id, + children = self._getChildrenBom(product_product_id=bomline.product_id, level=level, currlevel=currlevel + 1, bom_type=bom_type)