优化功能刀具等注册接口
This commit is contained in:
@@ -25,7 +25,8 @@ class StockLot(models.Model):
|
|||||||
val = {
|
val = {
|
||||||
'name': item.name,
|
'name': item.name,
|
||||||
'tool_material_status': item.tool_material_status,
|
'tool_material_status': item.tool_material_status,
|
||||||
'location': item.quant_ids[-1].location_id.name
|
'location': item.quant_ids[-1].location_id.name,
|
||||||
|
'tool_material_search_code': item.tool_material_search_id.code,
|
||||||
}
|
}
|
||||||
tool_material_stock_list.append(val)
|
tool_material_stock_list.append(val)
|
||||||
kw = json.dumps(tool_material_stock_list, ensure_ascii=False)
|
kw = json.dumps(tool_material_stock_list, ensure_ascii=False)
|
||||||
@@ -89,7 +90,7 @@ class ToolMaterial(models.Model):
|
|||||||
kw = json.dumps(tool_material_list, ensure_ascii=False)
|
kw = json.dumps(tool_material_list, ensure_ascii=False)
|
||||||
r = requests.post(str_url, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
r = requests.post(str_url, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
||||||
ret = r.json()
|
ret = r.json()
|
||||||
if r == 200:
|
if ret.get('code') == 200:
|
||||||
return '刀具物料注册成功'
|
return '刀具物料注册成功'
|
||||||
else:
|
else:
|
||||||
raise UserError("没有注册刀具物料信息")
|
raise UserError("没有注册刀具物料信息")
|
||||||
@@ -116,6 +117,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
'id': item.id,
|
'id': item.id,
|
||||||
'code': item.code,
|
'code': item.code,
|
||||||
'name': item.name,
|
'name': item.name,
|
||||||
|
'rfid': item.rfid,
|
||||||
'tool_groups_name': item.tool_groups_id.name,
|
'tool_groups_name': item.tool_groups_id.name,
|
||||||
'barcode': item.barcode_id.name,
|
'barcode': item.barcode_id.name,
|
||||||
'cutting_tool_type_code': item.sf_cutting_tool_type_id.code,
|
'cutting_tool_type_code': item.sf_cutting_tool_type_id.code,
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ class ToolMaterial(models.Model):
|
|||||||
product_id = fields.Many2one('product.product', string='刀具物料产品')
|
product_id = fields.Many2one('product.product', string='刀具物料产品')
|
||||||
|
|
||||||
name = fields.Char('名称', related='product_id.name')
|
name = fields.Char('名称', related='product_id.name')
|
||||||
code = fields.Char('编码', store=True)
|
code = fields.Char('编码', compute='_compute_code', store=True)
|
||||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料',
|
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料',
|
||||||
related='product_id.cutting_tool_material_id',
|
related='product_id.cutting_tool_material_id',
|
||||||
store=True,
|
store=True,
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="tool_material_status"/>
|
<field name="tool_material_status"/>
|
||||||
|
<button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
Reference in New Issue
Block a user