Merge branch 'feature/销售、刀具模块优化_1' into feature/线边料架接口优化
This commit is contained in:
@@ -436,6 +436,7 @@ class Manufacturing_Connect(http.Controller):
|
||||
DeciveId)))
|
||||
total_data = request.env['sf.shelf.location.datasync'].sudo().get_total_data()
|
||||
for item in shelfinfo:
|
||||
logging.info('货架已获取信息:%s' % item)
|
||||
shelf_barcode = request.env['sf.shelf.location.datasync'].sudo().find_our_code(
|
||||
total_data, item['Postion'])
|
||||
location_id = request.env['sf.shelf.location'].sudo().search(
|
||||
@@ -450,15 +451,15 @@ class Manufacturing_Connect(http.Controller):
|
||||
if tool:
|
||||
location_id.product_sn_id = tool.barcode_id.id
|
||||
# 修改功能刀具状态
|
||||
tool_state = {'Nomal': '正常', 'Warning': '报警'}
|
||||
if tool_state.get(item.get('State')):
|
||||
if tool_state.get(item.get('State')) != tool.functional_tool_status:
|
||||
if item.get('State') == '报警':
|
||||
if tool.functional_tool_status != item.get('State'):
|
||||
tool.write({
|
||||
'functional_tool_status': tool_state.get(item['State'])
|
||||
'functional_tool_status': item['State']
|
||||
})
|
||||
else:
|
||||
location_id.product_sn_id = False
|
||||
logging.info('货架已获取信息:%s' % item)
|
||||
if item['RfidCode']:
|
||||
logging.info('Rfid为【%s】的功能刀具在系统中不存在!' % item['RfidCode'])
|
||||
else:
|
||||
equipment_id = request.env['maintenance.equipment'].sudo().search([('name', '=', DeciveId)])
|
||||
if equipment_id:
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<attribute name="groups">sf_base.group_sale_salemanager,sf_base.group_sale_director</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_view_mrp_production']" position="attributes">
|
||||
<attribute name="groups">mrp.group_mrp_user,sf_base.group_sale_salemanager,sf_base.group_sale_director
|
||||
<attribute name="groups">
|
||||
mrp.group_mrp_user,sf_base.group_sale_salemanager,sf_base.group_sale_director
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='user_id']" position="replace">
|
||||
@@ -42,12 +43,12 @@
|
||||
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
|
||||
<button name="action_confirm" data-hotkey="v"
|
||||
string="确认接单" type="object" context="{'validate_analytic': True}"
|
||||
attrs="{'invisible': ['|','&','|',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&','&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('delivery_status', '!=', False),('state', 'in', ['cancel'])]}"/>
|
||||
attrs="{'invisible': ['|', ('state', 'in', ['cancel']), '|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&','&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('delivery_status', '!=', False)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': ['|','&','|', ('check_status', '!=', 'approved'),('state',
|
||||
'in', ['draft','cancel']),'&','&',('check_status', '=', 'approved'),('state', 'in',
|
||||
['sale','cancel']),('delivery_status', '!=', False), ('state', 'in', ['cancel'])]}
|
||||
<attribute name="attrs">{'invisible': ['|', ('state', 'in', ['cancel']), '|','&',
|
||||
('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&','&',('check_status',
|
||||
'=', 'approved'),('state', 'in', ['sale','cancel']),('delivery_status', '!=', False)]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_draft']" position="attributes">
|
||||
|
||||
@@ -110,6 +110,7 @@ class MrsShelfLocationDataSync(models.Model):
|
||||
total_data = self.get_total_data()
|
||||
print('shelfinfo:', shelfinfo)
|
||||
for item in shelfinfo:
|
||||
logging.info('货架已获取信息:%s' % item)
|
||||
shelf_barcode = self.find_our_code(total_data, item['Postion'])
|
||||
location_id = self.env['sf.shelf.location'].search([('barcode', '=', shelf_barcode)], limit=1)
|
||||
if location_id:
|
||||
@@ -121,14 +122,15 @@ class MrsShelfLocationDataSync(models.Model):
|
||||
if tool:
|
||||
location_id.product_sn_id = tool.barcode_id.id
|
||||
# 修改功能刀具状态
|
||||
tool_state = {'Nomal': '正常', 'Warning': '报警'}
|
||||
if tool_state.get(item.get('State')):
|
||||
if tool_state.get(item.get('State')) != tool.functional_tool_status:
|
||||
if item.get('State') == '报警':
|
||||
if tool.functional_tool_status != item.get('State'):
|
||||
tool.write({
|
||||
'functional_tool_status': tool_state.get(item['State'])
|
||||
'functional_tool_status': item['State']
|
||||
})
|
||||
else:
|
||||
location_id.product_sn_id = False
|
||||
if item['RfidCode']:
|
||||
logging.info('Rfid为【%s】的功能刀具在系统中不存在!' % item['RfidCode'])
|
||||
else:
|
||||
stock_lot_obj = self.env['stock.lot'].search([('rfid', '=', item['RfidCode'])], limit=1)
|
||||
if stock_lot_obj:
|
||||
@@ -136,7 +138,6 @@ class MrsShelfLocationDataSync(models.Model):
|
||||
else:
|
||||
location_id.product_sn_id = False
|
||||
|
||||
logging.info('货架已获取信息:%s' % item)
|
||||
except Exception as e:
|
||||
logging.info("捕获错误信息:%s" % e)
|
||||
raise ValidationError("数据错误导致同步失败,请联系管理员")
|
||||
|
||||
Reference in New Issue
Block a user