1、优化品牌同步接口,2、内部调拨作业详情添加Rfid字段;
This commit is contained in:
@@ -992,6 +992,7 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
work_state = {'done': '已完工'}
|
||||
raise UserError('装夹%s,请勿重复扫码' % work_state.get(workorder.state))
|
||||
lots = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
|
||||
logging.info("托盘信息:%s" % lots)
|
||||
if lots:
|
||||
for lot in lots:
|
||||
if lot.product_id.categ_type == '夹具':
|
||||
@@ -1010,6 +1011,7 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
if workorder_rfid:
|
||||
for item in workorder_rfid:
|
||||
item.write({'rfid_code': barcode})
|
||||
logging.info("Rfid绑定成功!!!")
|
||||
else:
|
||||
embryo_stock_lot = self.env['stock.lot'].search([('name', '=', barcode)])
|
||||
if embryo_stock_lot:
|
||||
@@ -1043,7 +1045,7 @@ class SfWorkOrderBarcodes(models.Model):
|
||||
for item in workorder_rfid:
|
||||
if item.state == "progress":
|
||||
item.write({'rfid_code': barcode})
|
||||
raise UserError('该托盘信息不存在!!!')
|
||||
# raise UserError('该托盘信息不存在!!!')
|
||||
# stock_move_line = self.env['stock.move.line'].search([('lot_name', '=', barcode)])
|
||||
# if stock_move_line.product_id.categ_type == '夹具':
|
||||
# workorder.write({
|
||||
|
||||
@@ -591,6 +591,7 @@ class MachineBrand(models.Model):
|
||||
if not brand:
|
||||
self.create({
|
||||
"name": item['name'],
|
||||
"active": item['active'],
|
||||
"code": item['code'],
|
||||
"remark": item['remark'],
|
||||
"image_brand": '' if not item['image_brand'] else base64.b64decode(item['image_brand']),
|
||||
@@ -599,6 +600,7 @@ class MachineBrand(models.Model):
|
||||
})
|
||||
else:
|
||||
brand.name = item['name']
|
||||
brand.active = item['active']
|
||||
brand.remark = item['remark']
|
||||
brand.image_brand = '' if not item['image_brand'] else base64.b64decode(item['image_brand'])
|
||||
brand.tag_ids = self.env['sf.machine.brand.tags'].search(
|
||||
|
||||
@@ -439,6 +439,12 @@ class Sf_stock_move_line(models.Model):
|
||||
there_is_no_sn = fields.Boolean('是否有序列号', default=False)
|
||||
|
||||
rfid = fields.Char('Rfid', readonly=True)
|
||||
rfid_barcode = fields.Char('Rfid', compute='_compute_rfid')
|
||||
|
||||
@api.depends('lot_id')
|
||||
def _compute_rfid(self):
|
||||
for item in self:
|
||||
item.rfid_barcode = item.lot_id.rfid
|
||||
|
||||
def action_revert_inventory(self):
|
||||
# 检查用户是否有执行操作的权限
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<field name="destination_location_id" domain="[('location_id', '=', location_dest_id_value), '|',
|
||||
('location_status', '=', '空闲'), ('product_id', '=', current_product_id), ('product_sn_id',
|
||||
'=', there_is_no_sn)]"/>
|
||||
|
||||
<field name="rfid_barcode" string="Rfid"/>
|
||||
|
||||
<!-- <field name="location_dest_id_product_type"/> -->
|
||||
<!-- <field name="location_dest_id"/> -->
|
||||
|
||||
Reference in New Issue
Block a user