坯料自加工的切割工序状态也判断了编程状态
This commit is contained in:
@@ -265,6 +265,23 @@ class MrpProduction(models.Model):
|
|||||||
|
|
||||||
part_name = fields.Char(string='零件名称', related='product_id.part_name', readonly=True)
|
part_name = fields.Char(string='零件名称', related='product_id.part_name', readonly=True)
|
||||||
|
|
||||||
|
# 判断制造的产品类型
|
||||||
|
production_product_type = fields.Selection([
|
||||||
|
('成品', '成品'),
|
||||||
|
('坯料', '坯料'),
|
||||||
|
('其他', '其他')
|
||||||
|
], string='产品类型', default='成品')
|
||||||
|
|
||||||
|
@api.onchange('product_id')
|
||||||
|
def onchange_product_id(self):
|
||||||
|
for record in self:
|
||||||
|
if record.product_id.categ_id.type == '成品':
|
||||||
|
record.production_product_type = '成品'
|
||||||
|
elif record.product_id.categ_id.type == '坯料':
|
||||||
|
record.production_product_type = '坯料'
|
||||||
|
else:
|
||||||
|
record.production_product_type = '其他'
|
||||||
|
|
||||||
@api.depends('product_id.manual_quotation')
|
@api.depends('product_id.manual_quotation')
|
||||||
def _compute_manual_quotation(self):
|
def _compute_manual_quotation(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
|||||||
@@ -1210,6 +1210,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# ================= 如果制造订单制造类型为【人工线下加工】==========================
|
# ================= 如果制造订单制造类型为【人工线下加工】==========================
|
||||||
if (workorder.production_id.production_type == '人工线下加工'
|
if (workorder.production_id.production_type == '人工线下加工'
|
||||||
and workorder.production_id.schedule_state == '已排'
|
and workorder.production_id.schedule_state == '已排'
|
||||||
|
and workorder.routing_type == '人工线下加工'
|
||||||
and len(workorder.production_id.picking_ids.filtered(
|
and len(workorder.production_id.picking_ids.filtered(
|
||||||
lambda w: w.state not in ['done', 'cancel'])) == 0
|
lambda w: w.state not in ['done', 'cancel'])) == 0
|
||||||
and workorder.production_id.programming_state == '已编程'):
|
and workorder.production_id.programming_state == '已编程'):
|
||||||
|
|||||||
@@ -116,12 +116,13 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//sheet//group//group//div[3]" position="after">
|
<xpath expr="//sheet//group//group//div[3]" position="after">
|
||||||
<field name="production_type" readonly="1"/>
|
<field name="production_type" readonly="1"/>
|
||||||
|
<field name="production_product_type" readonly="1" invisible="1"/>
|
||||||
<field name="manual_quotation" readonly="1"
|
<field name="manual_quotation" readonly="1"
|
||||||
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/>
|
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工']), ('production_product_type', '!=', '成品')]}"/>
|
||||||
<field name="programming_no" readonly="1"
|
<field name="programming_no" readonly="1"
|
||||||
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/>
|
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工']), ('production_product_type', '!=', '成品')]}"/>
|
||||||
<field name="programming_state" readonly="1"
|
<field name="programming_state" readonly="1"
|
||||||
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"
|
attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工']), ('production_product_type', '!=', '成品')]}"
|
||||||
decoration-success="programming_state == '已编程'"
|
decoration-success="programming_state == '已编程'"
|
||||||
decoration-warning="programming_state =='编程中'"
|
decoration-warning="programming_state =='编程中'"
|
||||||
decoration-danger="programming_state =='已编程未下发'"/>
|
decoration-danger="programming_state =='已编程未下发'"/>
|
||||||
@@ -416,7 +417,9 @@
|
|||||||
<span class="o_stat_text">子MO</span>
|
<span class="o_stat_text">子MO</span>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//sheet//notebook//page[last()]" position="after">
|
<xpath expr="//sheet//notebook//page[last()]" position="after">
|
||||||
<page string="编程记录">
|
<page string="编程记录" attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工']), ('production_product_type', '!=', '成品')]}">
|
||||||
|
<field name="production_type" invisible="1"/>
|
||||||
|
<field name="production_product_type" invisible="1"/>
|
||||||
<field name="programming_record_ids" widget="one2many" attrs="{'readonly': [('id', '!=', False)]}">
|
<field name="programming_record_ids" widget="one2many" attrs="{'readonly': [('id', '!=', False)]}">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="number"/>
|
<field name="number"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user