新增获取库区信息定时器

修改库存变更接口
This commit is contained in:
qihao.gong@jikimo.com
2024-02-23 15:31:25 +08:00
parent 99ba2d0a4d
commit c726bb614c
8 changed files with 57 additions and 14 deletions

View File

@@ -320,22 +320,20 @@ class Manufacturing_Connect(http.Controller):
workorder = request.env['mrp.workorder'].sudo().search(
[('rfid_code', '=', RfidCode)], limit=1)
if not workorder:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未找到该工单'}
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '根据RfidCode找到该工单'}
return json.JSONEncoder().encode(res)
old_localtion = request.env['sf.shelf.location'].sudo().search(
[('barcode', '=', OldPosition)], limit=1)
new_localtion = request.env['sf.shelf.location'].sudo().search(
[('barcode', '=', NewPosition)], limit=1)
if not new_localtion:
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '没有该存储位置'}
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '没有该目标位置'}
return json.JSONEncoder().encode(res)
if workorder and old_localtion and new_localtion:
if old_localtion:
old_localtion.location_status = '空闲'
new_localtion.location_status = '占用'
new_localtion.production_id = workorder.production_id.id
if old_localtion == 'None':
new_localtion.location_status = '占用'
new_localtion.production_id = workorder.production_id.id
old_localtion.production_id = False
new_localtion.location_status = '占用'
new_localtion.production_id = workorder.production_id.id
# return json.JSONEncoder().encode(res)
# else:
# res = {'Succeed': False, 'ErrorCode': 201, 'Error': '未传RfidCode字段'}

View File

@@ -103,7 +103,6 @@
<xpath expr="//field[@name='state']" position="before">
<field name='user_permissions' invisible="1"/>
<field name='name' invisible="1"/>
<field name='routing_type' invisible="1"/>
<field name='is_delivery' invisible="1"/>
<button name="button_start" type="object" string="开始" class="btn-success"
attrs="{'invisible': ['|', '|', '|','|',('production_state','in', ('draft', 'done',
@@ -160,6 +159,7 @@
</xpath>
<field name="production_id" position="after" invisible="0">
<group>
<field name='routing_type'/>
<field name="date_planned_start" invisible="1"/>
<field name="date_planned_finished" invisible="1"/>
<!-- <field name="production_id" readonly="1"/>-->