1、注释MES装刀指令接口,删除所以该接口的调用;注释质量检测失败时对零件特采接口的调用;2、序列号模型from界面临时添加按钮,解决工厂录入的有些刀柄序列号存在位数少于10的问题(通过SQL在左侧补零)(已隐藏);

This commit is contained in:
yuxianghui
2024-04-25 14:02:51 +08:00
parent 6f2043e7e7
commit 9d96e0681c
7 changed files with 34 additions and 32 deletions

View File

@@ -269,6 +269,13 @@ class ProductionLot(models.Model):
rfid = fields.Char('Rfid', readonly=True)
product_specification = fields.Char('规格', compute='_compute_product_specification', store=True)
def search_lot_put_rfid(self):
# 使用SQL将所有刀柄Rfid不满十位的值在前方补零
self.env.cr.execute(
'''UPDATE stock_lot SET rfid = LPAD(rfid, 10, '0') WHERE rfid IS NOT NULL AND LENGTH(rfid) < 10'''
)
self.env.cr.commit()
@api.depends('product_id')
def _compute_product_specification(self):
for stock in self: