Merge branch 'feature/功能刀具安全库存注册' into feature/刀柄入库录入Rfid

This commit is contained in:
yuxianghui
2024-04-01 16:56:56 +08:00
9 changed files with 171 additions and 103 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."""