增加排程结果反馈给制造订单的功能
This commit is contained in:
@@ -28,6 +28,9 @@
|
|||||||
<xpath expr="//field[@name='production_real_duration']" position="after">
|
<xpath expr="//field[@name='production_real_duration']" position="after">
|
||||||
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
|
<field name="reservation_state" optional="hide" decoration-danger="reservation_state == 'confirmed'" decoration-success="reservation_state == 'assigned'"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='state']" position="before">
|
||||||
|
<field name="schedule_state" optional="show"/>
|
||||||
|
</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>
|
||||||
|
|||||||
@@ -180,9 +180,11 @@ class sf_production_plan(models.Model):
|
|||||||
print(workorder_time)
|
print(workorder_time)
|
||||||
self.date_planned_finished = self.date_planned_start + timedelta(minutes=workorder_time)
|
self.date_planned_finished = self.date_planned_start + timedelta(minutes=workorder_time)
|
||||||
self.state = 'done'
|
self.state = 'done'
|
||||||
|
aa.schedule_state = '已排'
|
||||||
else:
|
else:
|
||||||
self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
raise ValidationError("未找到工单")
|
||||||
self.state = 'done'
|
# self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
||||||
|
# self.state = 'done'
|
||||||
return {
|
return {
|
||||||
'name': '排程甘特图',
|
'name': '排程甘特图',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
@@ -224,6 +226,8 @@ class sf_production_plan(models.Model):
|
|||||||
def cancel_production_schedule(self):
|
def cancel_production_schedule(self):
|
||||||
self.date_planned_finished = False
|
self.date_planned_finished = False
|
||||||
self.state = 'draft'
|
self.state = 'draft'
|
||||||
|
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
||||||
|
aa.schedule_state = '未排'
|
||||||
return self.date_planned_finished
|
return self.date_planned_finished
|
||||||
|
|
||||||
def liucheng_cs(self):
|
def liucheng_cs(self):
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<form string="订单计划">
|
<form string="订单计划">
|
||||||
<header>
|
<header>
|
||||||
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
<!-- <button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" icon="fa-step-forward"/> -->
|
||||||
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight"/>
|
<button string="执行排程" name="do_production_schedule" type="object" class="oe_highlight" options='{"calendar_view": true, "date_begin": "2020-01-01", "date_end": "2020-12-31"}'/>
|
||||||
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
|
<button string="取消排程" name="cancel_production_schedule" type="object" class="oe_highlight"/>
|
||||||
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
<!-- <button string="销售单" name="test_sale_order" type="object" class="oe_highlight"/> -->
|
||||||
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
<!-- <button string="测试流程" name="liucheng_cs" type="object" class="oe_highlight"/> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user