Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化agv和ftp
This commit is contained in:
@@ -131,6 +131,22 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
|
|||||||
dom.addClass('addRequired')
|
dom.addClass('addRequired')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
try {
|
||||||
|
const dom = this.tableRef.el
|
||||||
|
if(dom ) {
|
||||||
|
const tfoot = $(dom).children('tfoot')
|
||||||
|
const tbooy = $(dom).children('tbody')
|
||||||
|
if(tfoot.length) {
|
||||||
|
const tfoot_tr = tfoot.children().eq(0)
|
||||||
|
const tbody_tr = tbooy.children().eq(0)
|
||||||
|
if(tfoot_tr.children().length < tbody_tr.children().length) {
|
||||||
|
tfoot_tr.prepend('<td class="prepend">')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -489,3 +489,6 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
|
.o_list_renderer .o_list_table tfoot .o_list_number {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
@@ -496,3 +496,35 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||||
logging.info('AGVDownProduct error:%s' % e)
|
logging.info('AGVDownProduct error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
|
@http.route('/AutoDeviceApi/EquipmentBaseCoordinate', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
|
cors="*")
|
||||||
|
def PutEquipmentBaseCoordinate(self, **kw):
|
||||||
|
"""
|
||||||
|
获取机床基坐标
|
||||||
|
:param kw:
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
logging.info('PutEquipmentBaseCoordinate:%s' % kw)
|
||||||
|
try:
|
||||||
|
res = {'Succeed': True}
|
||||||
|
datas = request.httprequest.data
|
||||||
|
ret = json.loads(datas)
|
||||||
|
if 'DeviceId' in ret:
|
||||||
|
equipment = request.env['maintenance.equipment'].sudo().search('name', '=', ret['DeviceId'])
|
||||||
|
if equipment:
|
||||||
|
equipment.sudo().write({
|
||||||
|
'base_coordinate_fixture_model_id': ret['base_coordinate_fixture_model_id'],
|
||||||
|
'base_coordinate_g_coordinate': ret['base_coordinate_g_coordinate'],
|
||||||
|
'base_coordinate_x': ret['base_coordinate_x'],
|
||||||
|
'base_coordinate_y': ret['base_coordinate_y'],
|
||||||
|
'base_coordinate_z': ret['base_coordinate_z'],
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
res = {'Succeed': False, 'ErrorCode': 203, 'Error': 'DeviceId为%s的设备不存在!' % ret['DeviceId']}
|
||||||
|
else:
|
||||||
|
res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传DeviceId字段'}
|
||||||
|
except Exception as e:
|
||||||
|
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||||
|
logging.info('AGVDownProduct error:%s' % e)
|
||||||
|
return json.JSONEncoder().encode(res)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import logging
|
import logging
|
||||||
|
import requests
|
||||||
import base64
|
import base64
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
@@ -892,6 +893,33 @@ class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
|||||||
vals.append(res)
|
vals.append(res)
|
||||||
return vals[0]
|
return vals[0]
|
||||||
|
|
||||||
|
base_coordinate_fixture_model_id = fields.Many2one('sf.fixture.model', '基坐标卡盘型号',
|
||||||
|
domain=[('fixture_material_id', '=', '零点卡盘')])
|
||||||
|
base_coordinate_g_coordinate = fields.Char('G坐标')
|
||||||
|
base_coordinate_x = fields.Float('x轴', digits=(12, 3))
|
||||||
|
base_coordinate_y = fields.Float('y轴', digits=(12, 3))
|
||||||
|
base_coordinate_z = fields.Float('z轴', digits=(12, 3))
|
||||||
|
|
||||||
|
# ==========获取机床基坐标接口==========
|
||||||
|
def get_equipment_base_coordinate(self):
|
||||||
|
headers = {'Authorization': 'Ba F2CF5DCC-1A00-4234-9E95-65603F70CC8A'}
|
||||||
|
crea_url = "https://x24467i973.zicp.fun/AutoDeviceApi/EquipmentBaseCoordinate"
|
||||||
|
params = {"DeviceId": self.name}
|
||||||
|
r = requests.get(crea_url, params=params, headers=headers)
|
||||||
|
ret = r.json()
|
||||||
|
logging.info('register_equipment_tool:%s' % ret)
|
||||||
|
self.write({
|
||||||
|
'base_coordinate_fixture_model_id': ret['base_coordinate_fixture_model_id'],
|
||||||
|
'base_coordinate_g_coordinate': ret['base_coordinate_g_coordinate'],
|
||||||
|
'base_coordinate_x': ret['base_coordinate_x'],
|
||||||
|
'base_coordinate_y': ret['base_coordinate_y'],
|
||||||
|
'base_coordinate_z': ret['base_coordinate_z'],
|
||||||
|
})
|
||||||
|
if ret['Succeed']:
|
||||||
|
return "机床基坐标获取成功"
|
||||||
|
else:
|
||||||
|
raise ValidationError("机床基坐标获取失败")
|
||||||
|
|
||||||
|
|
||||||
class SfMaintenanceEquipmentTool(models.Model):
|
class SfMaintenanceEquipmentTool(models.Model):
|
||||||
_name = 'maintenance.equipment.tool'
|
_name = 'maintenance.equipment.tool'
|
||||||
|
|||||||
@@ -1,16 +1,31 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
设备增加刀具库位table
|
<!-- 设备增加刀具库位table-->
|
||||||
<record id="sf_manufacturing_hr_equipment_view_form" model="ir.ui.view">
|
<record id="sf_manufacturing_hr_equipment_view_form" model="ir.ui.view">
|
||||||
<field name="name">sf_manufacturing_equipment.form</field>
|
<field name="name">sf_manufacturing_equipment.form</field>
|
||||||
<field name="model">maintenance.equipment</field>
|
<field name="model">maintenance.equipment</field>
|
||||||
<field name="inherit_id" ref="sf_maintenance.sf_hr_equipment_view_form"/>
|
<field name="inherit_id" ref="sf_maintenance.sf_hr_equipment_view_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//page[@name='sf_equipment']" position="after">
|
<xpath expr="//page[@name='sf_equipment']" position="after">
|
||||||
|
<page string="机床基坐标" name="sf_equipment_base_coordinate"
|
||||||
|
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||||
|
<button name="get_equipment_base_coordinate" string="获取基坐标数据" type="object"
|
||||||
|
class="oe_highlight"/>
|
||||||
|
<separator invisible="0"/>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="base_coordinate_fixture_model_id" options="{'no_create': True}"/>
|
||||||
|
<field name="base_coordinate_g_coordinate"/>
|
||||||
|
<field name="base_coordinate_x"/>
|
||||||
|
<field name="base_coordinate_y"/>
|
||||||
|
<field name="base_coordinate_z"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
<page string="标准刀库" name="sf_equipment_product_template"
|
<page string="标准刀库" name="sf_equipment_product_template"
|
||||||
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||||
<field name = 'product_template_ids' >
|
<field name='product_template_ids'>
|
||||||
<tree editable='bottom'>
|
<tree editable='bottom'>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
@@ -422,6 +422,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
@api.depends('integral_freight_barcode')
|
@api.depends('integral_freight_barcode')
|
||||||
def _compute_integral_product_id(self):
|
def _compute_integral_product_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if item.integral_freight_barcode:
|
||||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.integral_freight_barcode)])
|
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.integral_freight_barcode)])
|
||||||
if location:
|
if location:
|
||||||
item.integral_product_id = location.product_id.id
|
item.integral_product_id = location.product_id.id
|
||||||
@@ -441,6 +442,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
@api.depends('blade_freight_barcode')
|
@api.depends('blade_freight_barcode')
|
||||||
def _compute_blade_product_id(self):
|
def _compute_blade_product_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if item.integral_freight_barcode:
|
||||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.blade_freight_barcode)])
|
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.blade_freight_barcode)])
|
||||||
if location:
|
if location:
|
||||||
item.blade_product_id = location.product_id.id
|
item.blade_product_id = location.product_id.id
|
||||||
@@ -460,6 +462,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
@api.depends('bar_freight_barcode')
|
@api.depends('bar_freight_barcode')
|
||||||
def _compute_bar_product_id(self):
|
def _compute_bar_product_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if item.integral_freight_barcode:
|
||||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.bar_freight_barcode)])
|
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.bar_freight_barcode)])
|
||||||
if location:
|
if location:
|
||||||
item.bar_product_id = location.product_id.id
|
item.bar_product_id = location.product_id.id
|
||||||
@@ -479,6 +482,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
@api.depends('pad_freight_barcode')
|
@api.depends('pad_freight_barcode')
|
||||||
def _compute_pad_product_id(self):
|
def _compute_pad_product_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if item.integral_freight_barcode:
|
||||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.pad_freight_barcode)])
|
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.pad_freight_barcode)])
|
||||||
if location:
|
if location:
|
||||||
item.pad_product_id = location.product_id.id
|
item.pad_product_id = location.product_id.id
|
||||||
@@ -519,6 +523,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
@api.depends('chuck_freight_barcode')
|
@api.depends('chuck_freight_barcode')
|
||||||
def _compute_chuck_product_id(self):
|
def _compute_chuck_product_id(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if item.integral_freight_barcode:
|
||||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.chuck_freight_barcode)])
|
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', item.chuck_freight_barcode)])
|
||||||
if location:
|
if location:
|
||||||
item.chuck_product_id = location.product_id.id
|
item.chuck_product_id = location.product_id.id
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
'default_current_barcode':barcode,
|
'default_current_barcode':barcode,
|
||||||
'default_current_product_id':product_id,
|
'default_current_product_id':product_id,
|
||||||
}"
|
}"
|
||||||
class="btn-primary"/>
|
class="btn-primary" attrs="{'invisible':[('location_status','!=','占用')]}"/>
|
||||||
<field name="location_status" invisible="1"/>
|
<field name="location_status" invisible="1"/>
|
||||||
<button string="禁用货位" name="action_location_status_disable" type="object"
|
<button string="禁用货位" name="action_location_status_disable" type="object"
|
||||||
class="oe_highlight"
|
class="oe_highlight"
|
||||||
@@ -245,6 +245,7 @@
|
|||||||
<field name="model">sf.shelf.location</field>
|
<field name="model">sf.shelf.location</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="货位">
|
<search string="货位">
|
||||||
|
<field name="barcode"/>
|
||||||
<searchpanel class="account_root">
|
<searchpanel class="account_root">
|
||||||
<!-- <field name="location_type" icon="fa-filter"/> -->
|
<!-- <field name="location_type" icon="fa-filter"/> -->
|
||||||
<!-- <field name="location_id" select="multi" icon="fa-filter"/> -->
|
<!-- <field name="location_id" select="multi" icon="fa-filter"/> -->
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class ShelfLocationWizard(models.TransientModel):
|
|||||||
shelf_location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.current_barcode)])
|
shelf_location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.current_barcode)])
|
||||||
# 变更货位
|
# 变更货位
|
||||||
if self.destination_barcode_id and shelf_location:
|
if self.destination_barcode_id and shelf_location:
|
||||||
if self.destination_barcode_id.product_id and self.destination_barcode_id.product_id == shelf_location.current_product_id and not self.destination_barcode_id.product_sn_id:
|
if self.destination_barcode_id.product_id and self.destination_barcode_id.product_id == shelf_location.product_id and not self.destination_barcode_id.product_sn_id:
|
||||||
self.destination_barcode_id.product_num += shelf_location.product_num
|
self.destination_barcode_id.product_num += shelf_location.product_num
|
||||||
else:
|
else:
|
||||||
self.destination_barcode_id.product_sn_id = shelf_location.product_sn_id.id
|
self.destination_barcode_id.product_sn_id = shelf_location.product_sn_id.id
|
||||||
|
|||||||
Reference in New Issue
Block a user