1、新增功能刀具拆解模型及其前端的tree、form视图,新增扫码录入需要拆解的功能刀具功能;
This commit is contained in:
@@ -243,11 +243,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
@api.depends('integral_freight_barcode')
|
||||
def _compute_integral_product_id(self):
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.integral_freight_barcode)])
|
||||
if location:
|
||||
self.integral_product_id = location.product_id.id
|
||||
else:
|
||||
self.integral_product_id = False
|
||||
if self.integral_freight_barcode:
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.integral_freight_barcode)])
|
||||
if location:
|
||||
self.integral_product_id = location.product_id.id
|
||||
else:
|
||||
self.integral_product_id = False
|
||||
|
||||
# ===============刀片型号====================
|
||||
blade_freight_barcode = fields.Char('刀片货位')
|
||||
@@ -261,11 +262,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
@api.depends('blade_freight_barcode')
|
||||
def _compute_blade_product_id(self):
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.blade_freight_barcode)])
|
||||
if location:
|
||||
self.blade_product_id = location.product_id.id
|
||||
else:
|
||||
self.blade_product_id = False
|
||||
if self.blade_freight_barcode:
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.blade_freight_barcode)])
|
||||
if location:
|
||||
self.blade_product_id = location.product_id.id
|
||||
else:
|
||||
self.blade_product_id = False
|
||||
|
||||
# ====================刀杆型号==================
|
||||
bar_freight_barcode = fields.Char('刀杆货位')
|
||||
@@ -279,11 +281,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
@api.depends('bar_freight_barcode')
|
||||
def _compute_bar_product_id(self):
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.bar_freight_barcode)])
|
||||
if location:
|
||||
self.bar_product_id = location.product_id.id
|
||||
else:
|
||||
self.bar_product_id = False
|
||||
if self.bar_freight_barcode:
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.bar_freight_barcode)])
|
||||
if location:
|
||||
self.bar_product_id = location.product_id.id
|
||||
else:
|
||||
self.bar_product_id = False
|
||||
|
||||
# ===============刀盘型号===================
|
||||
pad_freight_barcode = fields.Char('刀盘货位')
|
||||
@@ -297,11 +300,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
@api.depends('pad_freight_barcode')
|
||||
def _compute_pad_product_id(self):
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.pad_freight_barcode)])
|
||||
if location:
|
||||
self.pad_product_id = location.product_id.id
|
||||
else:
|
||||
self.pad_product_id = False
|
||||
if self.pad_freight_barcode:
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.pad_freight_barcode)])
|
||||
if location:
|
||||
self.pad_product_id = location.product_id.id
|
||||
else:
|
||||
self.pad_product_id = False
|
||||
|
||||
# ================刀柄型号===============
|
||||
handle_freight_rfid = fields.Char('刀柄Rfid', compute='_compute_rfid')
|
||||
@@ -335,11 +339,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
@api.depends('chuck_freight_barcode')
|
||||
def _compute_chuck_product_id(self):
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.chuck_freight_barcode)])
|
||||
if location:
|
||||
self.chuck_product_id = location.product_id.id
|
||||
else:
|
||||
self.chuck_product_id = False
|
||||
if self.chuck_freight_barcode:
|
||||
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', self.chuck_freight_barcode)])
|
||||
if location:
|
||||
self.chuck_product_id = location.product_id.id
|
||||
else:
|
||||
self.chuck_product_id = False
|
||||
|
||||
# ========================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user