Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

This commit is contained in:
mgw
2025-01-13 11:11:33 +08:00
8 changed files with 53 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ class MrpProduction(models.Model):
_description = "制造订单"
_order = 'create_date desc'
sale_order_id = fields.Many2one('sale.order', string='销售订单', compute='_compute_sale_order_id', store=True)
deadline_of_delivery = fields.Date('订单交期', tracking=True, compute='_compute_deadline_of_delivery')
deadline_of_delivery = fields.Date('订单交期', tracking=True, compute='_compute_deadline_of_delivery', store=True)
# tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘")
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
request_ids = fields.One2many('maintenance.request', 'production_id')

View File

@@ -40,6 +40,11 @@ class ResMrpWorkOrder(models.Model):
# workcenter_id = fields.Many2one('mrp.workcenter', string='工作中心', required=False)
users_ids = fields.Many2many("res.users", 'users_workorder', related="workcenter_id.users_ids")
processing_panel = fields.Char('加工面')
processing_panel_selection = fields.Selection([
('ZM', 'ZM'),
('FM', 'FM'),
('YC', 'YC'),
('QC', 'QC')], string="加工面", compute='_compute_processing_panel_selection', store=True)
sequence = fields.Integer(string='工序')
routing_type = fields.Selection([
('装夹预调', '装夹预调'),
@@ -63,6 +68,14 @@ class ResMrpWorkOrder(models.Model):
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效',
tracking=True)
@api.depends('processing_panel')
def _compute_processing_panel_selection(self):
for record in self:
if record.processing_panel in ['ZM', 'FM', 'YC', 'QC']:
record.processing_panel_selection = record.processing_panel
else:
record.processing_panel_selection = False
@api.depends('production_id.manual_quotation')
def _compute_manual_quotation(self):
for item in self:
@@ -130,7 +143,7 @@ class ResMrpWorkOrder(models.Model):
Y10_axis = fields.Float(default=0)
Z10_axis = fields.Float(default=0)
X_deviation_angle = fields.Integer(string="X轴偏差度", default=0)
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], default='合格',
test_results = fields.Selection([("合格", "合格"), ("返工", "返工")], default='合格',
string="检测结果", tracking=True)
cnc_ids = fields.One2many("sf.cnc.processing", 'workorder_id', string="CNC加工程序")
cmm_ids = fields.One2many("sf.cmm.program", 'workorder_id', string="CMM程序")

View File

@@ -581,6 +581,27 @@
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.view_mrp_production_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="string">单据编码</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="after">
<field name="part_name"/>
<field name="part_number"/>
<field name="sale_order_id"/>
<field name="deadline_of_delivery" icon="fa-calendar" enable_counters="1" filter_domain="[('deadline_of_delivery', 'ilike', self)]"/>
</xpath>
<xpath expr="//field[@name='product_variant_attributes']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='move_raw_ids']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='name'][last()]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//filter[@name='filter_in_progress']" position="before">
<filter string="返工" name="filter_rework" domain="[('state', '=', 'rework')]"/>
<filter string="报废" name="filter_scrap" domain="[('state', '=', 'scrap')]"/>