Accept Merge Request #1082: (feature/优化装夹预调工单 -> develop)
Merge Request: 优化装夹预调工单 Created By: @杨金灵 Reviewed By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1082?initial=true
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
@@ -1066,6 +1066,25 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
workorder.detection_report = base64.b64encode(open(report_file_path, 'rb').read())
|
workorder.detection_report = base64.b64encode(open(report_file_path, 'rb').read())
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# 重新下发nc程序
|
||||||
|
def button_send_program_again(self):
|
||||||
|
try:
|
||||||
|
res = {'programming_no': self.production_id.programming_no}
|
||||||
|
configsettings = self.env['res.config.settings'].get_values()
|
||||||
|
config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key'])
|
||||||
|
url = '/api/intelligent_programming/reset_state_again'
|
||||||
|
config_url = configsettings['sf_url'] + url
|
||||||
|
r = requests.post(config_url, json=res, data=None, headers=config_header)
|
||||||
|
r = r.json()
|
||||||
|
result = json.loads(r['result'])
|
||||||
|
if result['status'] == 1:
|
||||||
|
self.production_id.write({'work_state': '编程中', 'programming_state': '编程中'})
|
||||||
|
else:
|
||||||
|
raise UserError(result['message'])
|
||||||
|
except Exception as e:
|
||||||
|
logging.info('button_send_program_again error:%s' % e)
|
||||||
|
raise UserError("重新下发nc程序失败,请联系管理员")
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
class CNCprocessing(models.Model):
|
||||||
_name = 'sf.cnc.processing'
|
_name = 'sf.cnc.processing'
|
||||||
|
|||||||
@@ -151,7 +151,10 @@
|
|||||||
<!-- groups="sf_base.group_sf_mrp_user" -->
|
<!-- groups="sf_base.group_sf_mrp_user" -->
|
||||||
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
<!-- attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked'),('state','=','done')]}"/> -->
|
||||||
<button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"
|
<button name="button_workpiece_delivery" type="object" string="工件配送" class="btn-primary"
|
||||||
attrs="{'invisible': ['|',('routing_type','!=','装夹预调'),('is_delivery','=',True)]}"/>
|
attrs="{'invisible': ['|','|',('routing_type','!=','装夹预调'),('is_delivery','=',True),('state','!=','done')]}"/>
|
||||||
|
<button name="button_send_program_again" type="object" string="重新下发NC程序" class="btn-primary"
|
||||||
|
confirm="是否确认重新下发NC程序?"
|
||||||
|
attrs="{'invisible': ['|', ('routing_type','!=','装夹预调'),('state','=','done')]}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[1]" position="before">
|
<xpath expr="//page[1]" position="before">
|
||||||
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
<page string="开料要求" attrs='{"invisible": [("routing_type","!=","切割")]}'>
|
||||||
@@ -214,7 +217,7 @@
|
|||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
<field name="functional_fixture_type_id"
|
<field name="functional_fixture_type_id"
|
||||||
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
attrs='{"invisible": [("routing_type","!=","装夹预调")]}'/>
|
||||||
<field name="rfid_code" cache="True"
|
<field name="rfid_code" force_save="1" readonly="1" cache="True"
|
||||||
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
attrs="{'invisible': [('rfid_code_old', '!=', False)]}"/>
|
||||||
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
<field name="rfid_code_old" readonly="1" attrs="{'invisible': [('rfid_code_old', '=', False)]}"/>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user