1、功能刀具拆解单优化;2、完成 需求坯料序列号生成规则优化2;

This commit is contained in:
yuxianghui
2024-06-19 11:19:47 +08:00
parent 4497fb04c1
commit 6dae144d76
6 changed files with 49 additions and 17 deletions

View File

@@ -1143,7 +1143,10 @@ class CustomStockMove(models.Model):
move_lines = self.move_line_ids # 获取当前 stock.move 对应的所有 stock.move.line 记录
for line in move_lines:
if line.lot_name: # 确保 lot_name 存在
qr_data = self.compute_lot_qr_code(line.lot_name)
lot_name = line.lot_name
if line.product_id.categ_id.name == '坯料':
lot_name = lot_name.split('[', 1)[0]
qr_data = self.compute_lot_qr_code(lot_name)
# 假设 stock.move.line 模型中有一个字段叫做 lot_qr_code 用于存储二维码数据
line.lot_qr_code = qr_data
return result