Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -80,7 +80,7 @@ class StockLot(models.Model):
|
|||||||
headers = Common.get_headers(self, token, sf_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create"
|
str_url = sf_sync_config['sf_url'] + "/api/tool_material_stock/create"
|
||||||
product_ids = self.env['product.product'].sudo().search([('categ_type', '=', '刀具')]).ids
|
product_ids = self.env['product.product'].sudo().search([('categ_type', '=', '刀具')]).ids
|
||||||
objs_all = self.env['stock.lot'].search([('rfid', '!=', False), ('product_id', 'in', product_ids)])
|
objs_all = self.env['stock.lot'].search([('product_id', 'in', product_ids)])
|
||||||
self._get_sync_stock_lot(objs_all, str_url, token, headers)
|
self._get_sync_stock_lot(objs_all, str_url, token, headers)
|
||||||
|
|
||||||
def _get_sync_stock_lot(self, objs_all, str_url, token, headers):
|
def _get_sync_stock_lot(self, objs_all, str_url, token, headers):
|
||||||
@@ -90,6 +90,7 @@ class StockLot(models.Model):
|
|||||||
for item in objs_all:
|
for item in objs_all:
|
||||||
val = {
|
val = {
|
||||||
'name': item.name,
|
'name': item.name,
|
||||||
|
'qty': item.product_qty,
|
||||||
'tool_material_status': item.tool_material_status,
|
'tool_material_status': item.tool_material_status,
|
||||||
'location': [] if not item.quant_ids else item.quant_ids[-1].location_id.name,
|
'location': [] if not item.quant_ids else item.quant_ids[-1].location_id.name,
|
||||||
'tool_material_search_id': item.tool_material_search_id.id,
|
'tool_material_search_id': item.tool_material_search_id.id,
|
||||||
@@ -163,8 +164,6 @@ class ToolMaterial(models.Model):
|
|||||||
logging.info("刀具物料同步失败:%s" % e)
|
logging.info("刀具物料同步失败:%s" % e)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionalCuttingToolEntity(models.Model):
|
class FunctionalCuttingToolEntity(models.Model):
|
||||||
_inherit = 'sf.functional.cutting.tool.entity'
|
_inherit = 'sf.functional.cutting.tool.entity'
|
||||||
_description = '功能刀具列表注册'
|
_description = '功能刀具列表注册'
|
||||||
@@ -251,8 +250,6 @@ class FunctionalCuttingToolEntity(models.Model):
|
|||||||
logging.info("功能刀具同步失败:%s" % e)
|
logging.info("功能刀具同步失败:%s" % e)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionalToolWarning(models.Model):
|
class FunctionalToolWarning(models.Model):
|
||||||
_inherit = 'sf.functional.tool.warning'
|
_inherit = 'sf.functional.tool.warning'
|
||||||
_description = '功能刀具预警注册'
|
_description = '功能刀具预警注册'
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="rfid"/>
|
<field name="rfid"/>
|
||||||
|
<field name="product_qty"/>
|
||||||
<field name="tool_material_status"/>
|
<field name="tool_material_status"/>
|
||||||
<!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>-->
|
<!-- <button name="enroll_tool_material_stock" string="序列号注册" type="object" class="btn-primary"/>-->
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
Reference in New Issue
Block a user