1.修复材料型号同步报验证问题2.优化工单的工件派送3.计划里新增生产线的优化

This commit is contained in:
jinling.yang
2024-01-26 17:46:53 +08:00
parent 37161e2e20
commit cf2aaa38fe
7 changed files with 51 additions and 42 deletions

View File

@@ -67,6 +67,12 @@ class sf_production_plan(models.Model):
sequence = fields.Integer(string='序号', copy=False, readonly=True, index=True)
current_operation_name = fields.Char(string='当前工序名称', size=64, default='生产计划')
@api.onchange('production_line_id')
def _compute_production_line_id(self):
for item in self:
item.production_id.production_line_id = item.production_line_id.id
item.production_id.plan_start_processing_time = item.date_planned_start
@api.onchange('state')
def _onchange_state(self):
if self.state == 'finished':
@@ -324,23 +330,6 @@ class sf_production_plan(models.Model):
raise UserError(e)
class ReMrpProduction(models.Model):
_inherit = 'mrp.production'
production_line_id = fields.Many2one('sf.production.line', string='生产线', compute='_compute_production_line_id',
store=True)
plan_start_processing_time = fields.Datetime('计划开始加工时间')
@api.depends('name')
def _compute_production_line_id(self):
for production in self:
if production.name:
plan_production = self.env['sf.production.plan'].search([('production_id', '=', production.id)])
if plan_production:
production.production_line_id = plan_production.production_line_id
production.plan_start_processing_time = plan_production.date_planned_start
# 机台作业计划
class machine_work_schedule(models.Model):
_name = 'sf.machine.schedule'