Accept Merge Request #1030: (feature/制造代码优化 -> develop)

Merge Request: 优化刀具弹窗

Created By: @马广威
Accepted By: @马广威
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1030?initial=true
This commit is contained in:
马广威
2024-05-18 18:42:57 +08:00
committed by Coding

View File

@@ -831,10 +831,8 @@ class ProductProduct(models.Model):
new_time = datetime.strptime(str(fields.Date.today()), "%Y-%m-%d").strftime("%Y%m%d")
code += str(new_time) + '-'
stock_lot_id = self.env['stock.lot'].sudo().search(
[('name', 'like', new_time), ('product_id.name', '=', '功能刀具')],
limit=1,
order="id desc"
)
[('name', 'like', new_time), ('product_id.categ_type', '=', '功能刀具'),
('product_id.tracking', '=', 'serial')], limit=1, order="id desc")
if not stock_lot_id:
num = "%03d" % 1
else: