多供货方式选择

This commit is contained in:
胡尧
2024-11-11 11:06:56 +08:00
parent 28788e2a81
commit 1b87a81a5a
5 changed files with 17 additions and 8 deletions

View File

@@ -6,7 +6,7 @@
'author': 'fox', 'author': 'fox',
'website': '', 'website': '',
'category': '', 'category': '',
'depends': ['product', 'sf_dlm', 'sale_stock'], 'depends': ['product', 'sf_dlm', 'sale_stock', 'sf_sale'],
"data": [ "data": [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'data/stock_routes.xml', 'data/stock_routes.xml',

View File

@@ -1187,16 +1187,15 @@ class MrpProduction(models.Model):
'user_id': production.user_id.id} 'user_id': production.user_id.id}
return production_values_str return production_values_str
# 增加制造订单类型 # 增加制造订单类型
production_type = fields.Selection( production_type = fields.Selection(
[('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')], [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
string='制造订单类型', string='制造类型',
required=True,
compute='_compute_production_type', compute='_compute_production_type',
store=True store=True
) )
@api.depends('product_id') @api.depends('product_id.is_manual_processing')
def _compute_production_type(self): def _compute_production_type(self):
for production in self: for production in self:
production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工' production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工'

View File

@@ -35,9 +35,9 @@
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" <field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'"
decoration-success="reservation_state == 'assigned'"/> decoration-success="reservation_state == 'assigned'"/>
</xpath> </xpath>
<!-- <xpath expr="//field[@name='state']" position="before"> --> <xpath expr="//field[@name='state']" position="before">
<!-- <field name="schedule_state" optional="show"/> --> <field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'" decoration-success="production_type == '自动化产线加工'" optional="show"/>
<!-- </xpath> --> </xpath>
<xpath expr="//field[@name='activity_ids']" position="replace"> <xpath expr="//field[@name='activity_ids']" position="replace">
<field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/> <field name="activity_ids" string="下一个活动" widget="list_activity" optional="hide"/>
</xpath> </xpath>
@@ -80,6 +80,7 @@
</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="manual_quotation" readonly="1"/> <field name="manual_quotation" readonly="1"/>
<field name="programming_no" readonly="1"/> <field name="programming_no" readonly="1"/>
<field name="programming_state" readonly="1" <field name="programming_state" readonly="1"

View File

@@ -415,6 +415,14 @@ class sf_production_plan(models.Model):
print(ret) print(ret)
except Exception as e: except Exception as e:
raise UserError(e) raise UserError(e)
# 增加制造订单类型
production_type = fields.Selection(
[('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
string='制造类型',
related='production_id.production_type',
store=True
)
# 机台作业计划 # 机台作业计划

View File

@@ -22,6 +22,7 @@
<field name="production_line_id"/> <field name="production_line_id"/>
<field name="date_planned_start"/> <field name="date_planned_start"/>
<field name="date_planned_finished"/> <field name="date_planned_finished"/>
<field name="production_type" widget="badge" decoration-warning="production_type == '人工线下加工'" decoration-success="production_type == '自动化产线加工'"/>
<field name="actual_start_time" optional='hide'/> <field name="actual_start_time" optional='hide'/>
<field name="actual_end_time" optional='hide'/> <field name="actual_end_time" optional='hide'/>
<field name="actual_process_time" optional='hide'/> <field name="actual_process_time" optional='hide'/>