Accept Merge Request #1808: (feature/mrp_bug_fixed -> develop)

Merge Request: 修改配送类型的字段关联形式,修改工件配送列表页的默认筛选条件

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1808?initial=true
This commit is contained in:
胡尧
2025-02-17 13:24:31 +08:00
committed by Coding
8 changed files with 39 additions and 24 deletions

View File

@@ -19,12 +19,8 @@ class AgvScheduling(models.Model):
_order = 'id desc'
name = fields.Char('任务单号', index=True, copy=False)
def _get_agv_route_type_selection(self):
return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
agv_route_type = fields.Selection(selection=_get_agv_route_type_selection, string='任务类型', required=True)
agv_route_id = fields.Many2one('sf.agv.task.route', '任务路线')
agv_route_type = fields.Selection(related='agv_route_id.route_type', string='任务类型', required=True)
start_site_id = fields.Many2one('sf.agv.site', '起点接驳站', required=True)
end_site_id = fields.Many2one('sf.agv.site', '终点接驳站', tracking=True)
site_state = fields.Selection([

View File

@@ -69,6 +69,7 @@ class ResMrpWorkOrder(models.Model):
delivery_warning = fields.Selection([('normal', '正常'), ('warning', '告警'), ('overdue', '逾期')], string='时效',
tracking=True)
date_planned_start = fields.Datetime(tracking=True)
@api.depends('processing_panel')
def _compute_processing_panel_selection(self):
@@ -1858,11 +1859,7 @@ class WorkPieceDelivery(models.Model):
feeder_station_destination_id = fields.Many2one('sf.agv.site', '目的接驳站')
task_delivery_time = fields.Datetime('任务下发时间')
task_completion_time = fields.Datetime('任务完成时间')
def _get_agv_route_type_selection(self):
return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
type = fields.Selection(selection=_get_agv_route_type_selection, string='类型')
type = fields.Selection(related='route_id.route_type', string='类型')
delivery_duration = fields.Float('配送时长', compute='_compute_delivery_duration')
status = fields.Selection(
[('待下发', '待下发'), ('已下发', '待配送'), ('已配送', '已配送'), ('已取消', '已取消')], string='状态',

View File

@@ -785,6 +785,10 @@
<filter name="filter_to_be_issued" string="待下发" domain="[('status', 'in', ['待下发'])]"/>
<filter name="filter_issued" string="已下发" domain="[('status', 'in', ['已下发'])]"/>
<filter name="filter_delivered" string="已配送" domain="[('status', 'in', ['已配送'])]"/>
<separator/>
<filter name="filter_type_to_production_line" string="上产线" domain="[('type', '=', '上产线')]"/>
<filter name="filter_type_to_empty_racks" string="运送空料架" domain="[('type', '=', '运送空料架')]"/>
<filter name="filter_type_production_line_back" string="下产线" domain="[('type', '=', '下产线')]"/>
<field name="rfid_code"/>
<field name="production_id"/>
<field name="feeder_station_start_id"/>
@@ -807,7 +811,7 @@
<field name="res_model">sf.workpiece.delivery</field>
<field name="search_view_id" ref="sf_workpiece_delivery_search"/>
<field name="context">{'search_default_filter_to_be_issued': 1,
'search_default_filter_issued': 1}
'search_default_filter_type_to_production_line': 1}
</field>
<field name="view_mode">tree,form</field>
<field name="domain">

View File

@@ -54,10 +54,7 @@ class WorkpieceDeliveryWizard(models.TransientModel):
}
}
def _get_agv_route_type_selection(self):
return self.env['sf.agv.task.route'].fields_get(['route_type'])['route_type']['selection']
delivery_type = fields.Selection(selection=_get_agv_route_type_selection, string='类型')
delivery_type = fields.Selection(related='route_id.route_type', string='类型')
def dispatch_confirm(self):
if len(self.workorder_ids) < 4:

View File

@@ -156,4 +156,12 @@
<field name="model">product.product</field>
</record>
</data>
<data noupdate="1">
<record id="bussiness_plan_data_tracking" model="jikimo.message.bussiness.node">
<field name="name">计划数据异常跟踪</field>
<field name="model">mrp.workorder</field>
</record>
</data>
</odoo>

View File

@@ -402,4 +402,19 @@
事项:有{{num}}个质检单需要处理。</field>
</record>
</data>
<data noupdate="1">
<record id="template_plan_data_tracking" model="jikimo.message.template">
<field name="name">计划数据异常跟踪</field>
<field name="model_id" ref="mrp.model_mrp_workorder"/>
<field name="model">mrp.workorder</field>
<field name="bussiness_node_id" ref="bussiness_plan_data_tracking"/>
<field name="msgtype">markdown</field>
<field name="urgency">normal</field>
<field name="content">### 工单计划数据异常删除:
工单号:{{name}}
异动时间:{{write_date}}
</field>
</record>
</data>
</odoo>

View File

@@ -188,3 +188,10 @@ class SFMessageWork(models.Model):
])
if message_queue_ids:
message_queue_ids.write({'message_status': 'cancel'})
def write(self, vals):
res = super(SFMessageWork, self).write(vals)
if ('leave_id' in vals and vals['leave_id'] is False or 'date_planned_start' in vals and vals['date_planned_start'] is False) \
and self.schedule_state != '未排':
self.add_queue('计划数据异常跟踪')
return res

View File

@@ -77,15 +77,6 @@
<field name="title" string="标准名"/>
<field name="operation_id" invisible="1"/>
</xpath>
<xpath expr="//tree//field[@name='team_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//tree//field[@name='finished_lot_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//tree//field[@name='measure_on']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
</field>
</record>