修复模板类型工序
This commit is contained in:
@@ -49,15 +49,16 @@ class ResProductTemplate(models.Model):
|
||||
# 并根据模型类型计算出产品的胚料尺寸;
|
||||
@api.onchange('model_type_id')
|
||||
def count_embryo_size(self):
|
||||
bom = self.env['mrp.bom.line'].search(
|
||||
[('product_tmpl_id', '=', self.id)])
|
||||
bom = self.env['product.product'].search(
|
||||
[('categ_id.is_embryo', '=', True), ('product_tmpl_id', '=', self.id)],
|
||||
limit=1,
|
||||
order='volume desc'
|
||||
)
|
||||
for item in self:
|
||||
print(bom.product_tmpl_id)
|
||||
print(bom.model_long)
|
||||
item.model_long = bom.model_long + 1
|
||||
print(item.model_long)
|
||||
item.model_long = bom.embryo_long + 1
|
||||
item.embryo_width = bom.embryo_width + 1
|
||||
item.embryo_height = bom.embryo_height + 1
|
||||
item.volume = item.model_long * item.embryo_width * item.embryo_height
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user