1、序列号模型对象添加rfid字段且rfid仅在产品为刀柄时展示,序列号模型添加规格字段,且添加自动根据对应产品类型不同计算出其值,产品为夹具时看板展示其规格的值;2、在采购入库流程,录入序列号的过程界面添加录入rfid字段,当产品是刀柄时需录入刀柄的rfid,并在验证通过后刀柄的序列号中带有rfid码;

This commit is contained in:
yuxianghui
2024-03-29 17:37:02 +08:00
parent 71b7b07949
commit 48809cd654
5 changed files with 78 additions and 14 deletions

View File

@@ -222,6 +222,22 @@ class ProductionLot(models.Model):
_name = 'stock.lot'
_inherit = ['stock.lot', 'printing.utils']
rfid = fields.Char('Rfid', readonly=True)
product_material_name = fields.Char('刀具产品物料名称', related='product_id.cutting_tool_material_id.name')
product_specification = fields.Char('规格', compute='_compute_product_specification', store=True)
@api.depends('product_id')
def _compute_product_specification(self):
for stock in self:
if stock:
if stock.product_id:
if stock.product_id.categ_id.name in '刀具':
stock.product_specification = stock.product_id.specification_id.name
elif stock.product_id.categ_id.name in '夹具':
stock.product_specification = stock.product_id.specification_fixture_id.name
else:
stock.product_specification = stock.product_id.default_code
@api.model
def generate_lot_names1(self, display_name, first_lot, count):
"""Generate `lot_names` from a string."""