修改订单客供料显示,修改内部调拨、生产发料合并单据

This commit is contained in:
胡尧
2024-11-20 16:53:15 +08:00
parent fabcca1188
commit a7ed317b09
5 changed files with 112 additions and 29 deletions

View File

@@ -133,7 +133,7 @@ class ReSaleOrder(models.Model):
'product_uom_qty': item['number'],
'model_glb_file': base64.b64decode(item['model_file']),
'remark': item.get('remark'),
'embryo_redundancy_id': item.get('embryo_redundancy_id'),
'is_incoming_material': True if item.get('embryo_redundancy_id') else False,
'manual_quotation': item.get('manual_quotation')
}
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)
@@ -175,10 +175,15 @@ class ResaleOrderLine(models.Model):
check_status = fields.Selection(related='order_id.check_status')
remark = fields.Char('备注')
# is_incoming_material = fields.Boolean('客供料', default=False)
is_incoming_material = fields.Boolean('客供料', compute='_compute_is_incoming_material', store=True)
embryo_redundancy_id = fields.Many2one('sf.embryo.redundancy', '坯料冗余')
manual_quotation = fields.Boolean('人工编程', default=False)
@api.depends('embryo_redundancy_id')
def _compute_is_incoming_material(self):
for line in self:
line.is_incoming_material = True if line.embryo_redundancy_id else False
@api.depends('product_template_id')
def _compute_model_glb_file(self):
for line in self: