Merge branch 'feature/中控对接接口优化' into feature/中控接口注释及工厂数据处理

# Conflicts:
#	sf_manufacturing/views/mrp_production_addional_change.xml
This commit is contained in:
yuxianghui
2024-04-25 14:10:22 +08:00
11 changed files with 74 additions and 34 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: