CNC获取程序工单自动开始 并获取cnc程序到mrs编程单
This commit is contained in:
@@ -136,6 +136,7 @@ class MrpProduction(models.Model):
|
|||||||
for workorder in production.workorder_ids:
|
for workorder in production.workorder_ids:
|
||||||
workorder.duration_expected = workorder._get_duration_expected()
|
workorder.duration_expected = workorder._get_duration_expected()
|
||||||
|
|
||||||
|
|
||||||
#在之前的销售单上重新生成制造订单
|
#在之前的销售单上重新生成制造订单
|
||||||
def create_production1_values(self, production):
|
def create_production1_values(self, production):
|
||||||
production_values_str = {'origin': production.origin,
|
production_values_str = {'origin': production.origin,
|
||||||
@@ -232,6 +233,9 @@ class MrpProduction(models.Model):
|
|||||||
for work in rec.workorder_ids:
|
for work in rec.workorder_ids:
|
||||||
work.sequence = current_sequence
|
work.sequence = current_sequence
|
||||||
current_sequence += 1
|
current_sequence += 1
|
||||||
|
if work.name == '获取CNC加工程序':
|
||||||
|
work.button_start()
|
||||||
|
work.fetchCNC()
|
||||||
|
|
||||||
#创建工单并进行排序
|
#创建工单并进行排序
|
||||||
def _create_workorder(self):
|
def _create_workorder(self):
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
<field name="date_planned_finished" string="计划结束日期" optional="show"/>
|
<field name="date_planned_finished" string="计划结束日期" optional="show"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='button_start']" position="attributes">
|
<xpath expr="//button[@name='button_start']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
<attribute name="attrs">{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', 'done',
|
||||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||||
('is_user_working', '!=', False),("user_permissions","=",False)]}
|
('is_user_working', '!=', False),("user_permissions","=",False),("name","=","获取CNC加工程序")]}
|
||||||
</attribute>
|
</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
<xpath expr="//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': [("user_permissions","=",False)]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',("user_permissions","=",False),("name","=","获取CNC加工程序")]}</attribute>
|
||||||
<attribute name="string">停工</attribute>
|
<attribute name="string">停工</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
<xpath expr="//button[@name='action_open_wizard']" position="attributes">
|
||||||
@@ -103,20 +103,21 @@
|
|||||||
<xpath expr="//field[@name='state']" position="before">
|
<xpath expr="//field[@name='state']" position="before">
|
||||||
|
|
||||||
<field name='user_permissions' invisible="1"/>
|
<field name='user_permissions' invisible="1"/>
|
||||||
|
<field name='name' invisible="1"/>
|
||||||
<button name="button_start" type="object" string="开始" class="btn-success"
|
<button name="button_start" type="object" string="开始" class="btn-success"
|
||||||
attrs="{'invisible': ['|', '|', '|','|', ('production_state','in', ('draft', 'done',
|
attrs="{'invisible': ['|', '|', '|','|','|', ('production_state','in', ('draft', 'done',
|
||||||
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')),
|
||||||
('is_user_working', '!=', False),('user_permissions','=',False)]}"/>
|
('is_user_working', '!=', False),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
<button name="button_pending" type="object" string="暂停" class="btn-warning"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="button_finish" type="object" string="完成" class="btn-success"
|
<button name="button_finish" type="object" string="完成" class="btn-success"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}"/>
|
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="停工"
|
||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False)]}"/>
|
attrs="{'invisible': ['|', '|','|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'),('user_permissions','=',False),('name','=','获取CNC加工程序')]}"/>
|
||||||
<button name="button_unblock" type="object" string="Unblock"
|
<button name="button_unblock" type="object" string="Unblock"
|
||||||
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/>
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('name','=','获取CNC加工程序')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!-- 隐藏物料清单-->
|
<!-- 隐藏物料清单-->
|
||||||
<xpath expr="//page[@name='components']" position="attributes">
|
<xpath expr="//page[@name='components']" position="attributes">
|
||||||
|
|||||||
Reference in New Issue
Block a user