1、工单tree视图、from视图添加人工编程字段,及人工编程筛选项;2、序列号模型添加根据Rfid搜索的选项;3、修改零件特采接口,优化MES装刀申请接口、优化机床刀库接口;
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<searchpanel>
|
||||
<field name="routing_type" select="multi" string="工序类型" icon="fa-building" enable_counters="1"/>
|
||||
<field name="state" select="multi" string="状态" icon="fa-building" enable_counters="1"/>
|
||||
<!-- <field name="manual_quotation" select="multi" string="" icon="fa-building" enable_counters="1"/>-->
|
||||
</searchpanel>
|
||||
|
||||
<!-- <field name="name" filter_domain="['|', '|', ('明确的字段内容', 'ilike', self), ('shortdesc', 'ilike', self), ('name', 'ilike', self)]" string="Theme"/>-->
|
||||
@@ -19,7 +20,11 @@
|
||||
<!-- <xpath expr="//search//group//filter[@name='product']" position="before">-->
|
||||
<!-- <filter string="Tray code" name="traycode" domain="[]" context="{'group_by': 'tray_code'}"/>-->
|
||||
<!-- </xpath>-->
|
||||
|
||||
<xpath expr="//filter[@name='date_start_filter']" position="after">
|
||||
<separator/>
|
||||
<filter string="人工编程" name="manual_quotation" domain="[('manual_quotation', '=', True)]"/>
|
||||
<filter string="自动编程" name="no_manual_quotation" domain="[('manual_quotation', '=', False)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -66,6 +66,7 @@
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="manual_quotation" readonly="1"/>
|
||||
<field name="programming_no" readonly="1"/>
|
||||
<field name="work_state" invisible="1"/>
|
||||
<field name="schedule_state" invisible='1'/>
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
<field name="product_id" position="after">
|
||||
<field name="equipment_id" optional="hide"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='qty_remaining']" position="after">
|
||||
<field name="manual_quotation" optional="show"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='date_planned_start']" position="replace">
|
||||
<field name="date_planned_start" string="计划开始日期" optional="show"/>
|
||||
</xpath>
|
||||
@@ -173,6 +176,8 @@
|
||||
attrs="{'invisible': [('production_state','=', 'draft')], 'readonly': [('is_user_working', '=', True)]}"
|
||||
sum="real duration"/>
|
||||
<field name="glb_file" readonly="1" widget="Viewer3D" string="加工模型"/>
|
||||
<field name="manual_quotation" readonly="1"
|
||||
attrs="{'invisible': [('routing_type', '!=', 'CNC加工')]}"/>
|
||||
<field name="processing_panel" readonly="1"
|
||||
attrs='{"invisible": [("routing_type","in",("获取CNC加工程序","切割"))]}'/>
|
||||
<field name="equipment_id"
|
||||
|
||||
@@ -21,4 +21,26 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="search_product_lot_view" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.view</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.search_product_lot_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="after">
|
||||
<field name="rfid"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_production_lot_view_tree_tree" model="ir.ui.view">
|
||||
<field name="name">stock.production.lot.tree.inherit.product.expiry</field>
|
||||
<field name="model">stock.lot</field>
|
||||
<field name="inherit_id" ref="stock.view_production_lot_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='create_date']" position="after">
|
||||
<field name="rfid" invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -20,6 +20,9 @@ class QualityCheck(models.Model):
|
||||
production_id = self.env['mrp.production'].sudo().search([('name', '=', origin)])
|
||||
rfid = '' if not production_id.workorder_ids else production_id.workorder_ids[-1].rfid_code or ''
|
||||
val = [rfid]
|
||||
# todo 需修改
|
||||
val = ['0037818516']
|
||||
logging.info('获取到的工单信息%s' % val)
|
||||
r = requests.post(crea_url, json=val, headers=headers)
|
||||
ret = r.json()
|
||||
logging.info('_register_quality_check:%s' % ret)
|
||||
|
||||
@@ -63,10 +63,11 @@ class SfMaintenanceEquipment(models.Model):
|
||||
for data in datas:
|
||||
maintenance_equipment_id = self.search([('name', '=', data['DeviceId'])])
|
||||
if maintenance_equipment_id:
|
||||
tool_id = '%s%s' % (data['ToolId'][0:1], data['ToolId'][1:].zfill(2))
|
||||
equipment_tool_id = self.env['maintenance.equipment.tool'].sudo().search(
|
||||
[('equipment_id', '=', maintenance_equipment_id.id), ('code', '=', data['ToolId'])])
|
||||
[('equipment_id', '=', maintenance_equipment_id.id), ('code', '=', tool_id)])
|
||||
functional_tool_id = self.env['sf.functional.cutting.tool.entity'].sudo().search(
|
||||
[('rfid', '=', data['RfidCode'])])
|
||||
[('rfid', '=', str(int(data['RfidCode'])))])
|
||||
time = None
|
||||
if data['AddDatetime']:
|
||||
datatime = str(data['AddDatetime'])
|
||||
|
||||
@@ -16,10 +16,11 @@ class CNCprocessing(models.Model):
|
||||
# token = sf_sync_config['token'Ba F2CF5DCC-1A00-4234-9E95-65603F70CC8A]
|
||||
headers = {'Authorization': config['center_control_Authorization']}
|
||||
crea_url = config['center_control_url'] + "/AutoDeviceApi/ToolLoadInstruct"
|
||||
# todo
|
||||
val = {
|
||||
'DeviceId': knife_plan.machine_table_name,
|
||||
'RfidCode': knife_plan.sf_functional_tool_assembly_id.rfid,
|
||||
'ToolId': int(knife_plan.cutter_spacing_code_id.code[1:])
|
||||
'RfidCode': knife_plan.sf_functional_tool_assembly_id.rfid.zfill(10),
|
||||
'ToolId': int(knife_plan.cam_cutter_spacing_code[1:])
|
||||
}
|
||||
r = requests.post(crea_url, json=val, headers=headers)
|
||||
ret = r.json()
|
||||
|
||||
Reference in New Issue
Block a user