修改订单客供料显示,修改内部调拨、生产发料合并单据
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<field name="name" widget="section_and_note_text" optional="show"
|
||||
string="参数说明(长/宽/高/体积/精度/材质)"/>
|
||||
<field name="manual_quotation" readonly="1"/>
|
||||
<field name="embryo_redundancy_id" readonly="1"/>
|
||||
<field name="is_incoming_material" readonly="1"/>
|
||||
</xpath>
|
||||
<field name="user_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||
@@ -167,7 +167,7 @@
|
||||
<!--新增带料字段-->
|
||||
<xpath expr="//field[@name='order_line']/form//group//group//field[@name='analytic_distribution']" position="after">
|
||||
<field name="manual_quotation" />
|
||||
<field name="embryo_redundancy_id"/>
|
||||
<field name="is_incoming_material"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user