优化工单
This commit is contained in:
@@ -429,7 +429,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('LocationChange error:%s' % e)
|
logging.info('LocationChange error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVToProduct(self, **kw):
|
def AGVToProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -490,7 +490,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('AGVToProduct error:%s' % e)
|
logging.info('AGVToProduct error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVDownProduct(self, **kw):
|
def AGVDownProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -869,7 +869,7 @@ class MrpProduction(models.Model):
|
|||||||
if download_state is False:
|
if download_state is False:
|
||||||
raise UserError('编程单号为%s的CNC程序文件从FTP拉取失败' % (self.programming_no))
|
raise UserError('编程单号为%s的CNC程序文件从FTP拉取失败' % (self.programming_no))
|
||||||
productions = self.env['mrp.production'].search(
|
productions = self.env['mrp.production'].search(
|
||||||
[('programming_no', '=', self.programming_no), ('state', 'not in', ('cancel', 'done', 'scrap'))])
|
[('programming_no', '=', self.programming_no), ('state', 'not in', ('cancel', 'done'))])
|
||||||
if productions:
|
if productions:
|
||||||
for production in productions:
|
for production in productions:
|
||||||
panel_workorder = production.workorder_ids.filtered(lambda
|
panel_workorder = production.workorder_ids.filtered(lambda
|
||||||
|
|||||||
@@ -907,7 +907,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
elif workorder.routing_type == '解除装夹' and workorder.state not in ['done', 'rework', 'cancel']:
|
elif workorder.routing_type == '解除装夹' and workorder.state not in ['done', 'rework', 'cancel']:
|
||||||
if cnc_workorder:
|
if cnc_workorder:
|
||||||
if not cnc_workorder_pending:
|
if not cnc_workorder_pending or unclamp_workorder.test_results == '报废':
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
# else:
|
# else:
|
||||||
# if workorder.production_id.is_rework is True:
|
# if workorder.production_id.is_rework is True:
|
||||||
|
|||||||
@@ -121,17 +121,17 @@
|
|||||||
string="验证" type="object" data-hotkey="g"
|
string="验证" type="object" data-hotkey="g"
|
||||||
groups="sf_base.group_sf_mrp_user"/>
|
groups="sf_base.group_sf_mrp_user"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="(//header//button[@name='button_scrap'])" position="replace">
|
<!-- <xpath expr="(//header//button[@name='button_scrap'])" position="replace">-->
|
||||||
<button name="button_scrap" invisible="1"/>
|
<!-- <button name="button_scrap" invisible="1"/>-->
|
||||||
<button name="do_update_program" string="更新程序" type="object" groups="sf_base.group_sf_mrp_user"
|
<!-- <button name="do_update_program" string="更新程序" type="object" groups="sf_base.group_sf_mrp_user"-->
|
||||||
confirm="是否确认更新程序"
|
<!-- confirm="是否确认更新程序"-->
|
||||||
attrs="{'invisible': ['|',('state', '!=', 'rework'),('programming_state', '!=', '已编程未下发')]}"/>
|
<!-- attrs="{'invisible': ['|',('state', '!=', 'rework'),('programming_state', '!=', '已编程未下发')]}"/>-->
|
||||||
<button name="button_rework" string="返工" type="object" groups="sf_base.group_sf_mrp_user"
|
<!-- <button name="button_rework" string="返工" type="object" groups="sf_base.group_sf_mrp_user"-->
|
||||||
attrs="{'invisible': ['|',('state', '!=', 'rework') ,('programming_state', '!=', '已编程')]}"/>
|
<!-- attrs="{'invisible': ['|',('state', '!=', 'rework') ,('programming_state', '!=', '已编程')]}"/>-->
|
||||||
<button name="%(sf_manufacturing.action_sf_production_wizard)d" string="报废" type="action"
|
<!-- <button name="%(sf_manufacturing.action_sf_production_wizard)d" string="报废" type="action"-->
|
||||||
groups="sf_base.group_sf_mrp_user"
|
<!-- groups="sf_base.group_sf_mrp_user"-->
|
||||||
attrs="{'invisible': [('is_scrap', '=', False)]}"/>
|
<!-- attrs="{'invisible': [('is_scrap', '=', False)]}"/>-->
|
||||||
</xpath>
|
<!-- </xpath>-->
|
||||||
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
|
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
|
||||||
<button name="button_mark_done" attrs="{'invisible': [
|
<button name="button_mark_done" attrs="{'invisible': [
|
||||||
'|',
|
'|',
|
||||||
|
|||||||
Reference in New Issue
Block a user