1、注释action_apply_inventory()方法;2、功能刀具安全库存添加one2many类型的功能刀具废弃many2many类型的关联字段并优化代码,并在功能刀具模型添加功能按钮用来绑定功能刀具和对应的功能刀具安全库存;3、优化根据库存创建功能刀具组装单的方法断定条件;4、优化刀具注册接口的报错处理;5、优化组装流程

This commit is contained in:
yuxianghui
2024-05-18 11:54:23 +08:00
parent 305e91e7f1
commit 9e2091597b
5 changed files with 275 additions and 243 deletions

View File

@@ -715,15 +715,15 @@ class ReStockMove(models.Model):
class ReStockQuant(models.Model):
_inherit = 'stock.quant'
def action_apply_inventory(self):
inventory_diff_quantity = self.inventory_diff_quantity
super(ReStockQuant, self).action_apply_inventory()
if inventory_diff_quantity >= 1:
stock = self.env['stock.move'].search([('product_id', '=', self.product_id.id), ('is_inventory', '=', True),
('reference', '=', '更新的产品数量'), ('state', '=', 'done')],
limit=1, order='id desc')
if self.product_id.categ_type == '夹具':
stock._register_fixture()
elif self.product_id.categ_type == '刀具':
stock._register_cutting_tool()
return True
# def action_apply_inventory(self):
# inventory_diff_quantity = self.inventory_diff_quantity
# super(ReStockQuant, self).action_apply_inventory()
# if inventory_diff_quantity >= 1:
# stock = self.env['stock.move'].search([('product_id', '=', self.product_id.id), ('is_inventory', '=', True),
# ('reference', '=', '更新的产品数量'), ('state', '=', 'done')],
# limit=1, order='id desc')
# if self.product_id.categ_type == '夹具':
# stock._register_fixture()
# elif self.product_id.categ_type == '刀具':
# stock._register_cutting_tool()
# return True