优化同步库区功能(线边刀、线边料)
This commit is contained in:
@@ -20,10 +20,12 @@ class MrsShelfLocationDataSync(models.Model):
|
|||||||
for item in shelfinfo:
|
for item in shelfinfo:
|
||||||
location_id = self.env['sf.shelf.location'].search([('barcode', '=', item['Postion'])], limit=1)
|
location_id = self.env['sf.shelf.location'].search([('barcode', '=', item['Postion'])], limit=1)
|
||||||
if location_id:
|
if location_id:
|
||||||
workorder_id = self.env['mrp.workorder'].search([('rfid_code', '=', item['RfidCode'])], limit=1)
|
stock_lot_obj = self.env['stock.lot'].search([('rfid', '=', item['RfidCode'])], limit=1)
|
||||||
if workorder_id:
|
if stock_lot_obj:
|
||||||
location_id.production_id = workorder_id.production_id.id
|
location_id.product_sn_id = stock_lot_obj.id
|
||||||
location_id.location_status = '占用'
|
else:
|
||||||
|
location_id.product_sn_id = False
|
||||||
|
|
||||||
logging.info('货架已获取信息:%s' % item)
|
logging.info('货架已获取信息:%s' % item)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.info("捕获错误信息:%s" % e)
|
logging.info("捕获错误信息:%s" % e)
|
||||||
|
|||||||
Reference in New Issue
Block a user