1、销售订单状态添加【加工中】、【物流中】、【已交付】三种状态;2、优化 获取mrs下发的编程单 接口,添加对返工重新编程的处理
This commit is contained in:
@@ -13,6 +13,9 @@ class SaleOrder(models.Model):
|
|||||||
('sent', "报价已发送"),
|
('sent', "报价已发送"),
|
||||||
('supply method', "供货方式待确认"),
|
('supply method', "供货方式待确认"),
|
||||||
('sale', "销售订单"),
|
('sale', "销售订单"),
|
||||||
|
('processing', "加工中"),
|
||||||
|
('physical_distribution', "物流中"),
|
||||||
|
('delivered', "已交付"),
|
||||||
('done', "已锁定"),
|
('done', "已锁定"),
|
||||||
('cancel', "已取消"),
|
('cancel', "已取消"),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<button name="action_confirm" string="供货方式确认" type="object" attrs="{'invisible': [('state', '!=', 'supply method')]}" confirm="确认供货方式"/>
|
<button name="action_confirm" string="供货方式确认" type="object" attrs="{'invisible': [('state', '!=', 'supply method')]}" confirm="确认供货方式"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//header/field[@name='state']" position="attributes">
|
<xpath expr="//header/field[@name='state']" position="attributes">
|
||||||
<attribute name="statusbar_visible">draft,sent,supply method,sale</attribute>
|
<attribute name="statusbar_visible">supply method,sale,processing,physical_distribution,delivered</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page/field[@name='order_line']/tree/field[@name='remark']" position="before">
|
<xpath expr="//page/field[@name='order_line']/tree/field[@name='remark']" position="before">
|
||||||
<field name="supply_method" attrs="{'invisible': [('state', '=', 'draft')], 'required': [('state', '=', 'supply method')]}" />
|
<field name="supply_method" attrs="{'invisible': [('state', '=', 'draft')], 'required': [('state', '=', 'supply method')]}" />
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
|||||||
ret = json.loads(ret['result'])
|
ret = json.loads(ret['result'])
|
||||||
logging.info('下发编程单:%s' % ret)
|
logging.info('下发编程单:%s' % ret)
|
||||||
domain = [('programming_no', '=', ret['programming_no'])]
|
domain = [('programming_no', '=', ret['programming_no'])]
|
||||||
if ret['manufacturing_type'] in ('scrap', 'invalid_tool_rework'):
|
if ret['manufacturing_type'] in ('scrap', 'invalid_tool_rework', 'rework'):
|
||||||
domain += [('state', 'not in', ['done', 'scrap', 'cancel'])]
|
domain += [('state', 'not in', ['done', 'scrap', 'cancel'])]
|
||||||
else:
|
else:
|
||||||
domain += [('state', 'in', ['confirmed', 'pending_cam'])]
|
domain += [('state', 'in', ['confirmed', 'pending_cam'])]
|
||||||
@@ -56,7 +56,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
|
|||||||
res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no'])
|
res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no'])
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
for production in productions:
|
for production in productions:
|
||||||
production.write({'programming_state': '已编程', 'work_state': '已编程'})
|
production.write({'programming_state': '已编程', 'work_state': '已编程', 'is_rework': False})
|
||||||
for panel in ret['processing_panel'].split(','):
|
for panel in ret['processing_panel'].split(','):
|
||||||
# 查询状态为进行中且工序类型为CNC加工的工单
|
# 查询状态为进行中且工序类型为CNC加工的工单
|
||||||
cnc_workorder_has = production.workorder_ids.filtered(
|
cnc_workorder_has = production.workorder_ids.filtered(
|
||||||
|
|||||||
Reference in New Issue
Block a user