功能刀具清单 bom添加查询排序与清单明细行删除校验

This commit is contained in:
liaodanlong
2024-09-11 10:23:02 +08:00
parent e1f7aeaa96
commit 9eee8557c2
5 changed files with 40 additions and 6 deletions

View File

@@ -5,10 +5,10 @@ from odoo.http import request
class ToolInventory(models.Model):
_inherit = 'sf.tool.inventory'
_description = '功能刀具清单'
knife_handle_model = fields.Selection([('BT30', 'BT30'), ('BT40', 'BT40'), ('BT50', 'BT50'), ('GSK30', 'GSK30'), ('GSK40', 'GSK40'), ('GSK50', 'GSK50')], string='使用刀柄型号')
knife_handle_model = fields.Selection([('BT30', 'BT30'), ('BT40', 'BT40'), ('BT50', 'BT50'), ('GSK30', 'GSK30'), ('GSK40', 'GSK40'), ('GSK50', 'GSK50')], string='使用刀柄型号', required=True)
jikimo_bom_ids = fields.One2many('jikimo.bom','tool_inventory_id', 'bom单')
blade_length = fields.Float('刃长(mm)')
def bom_mainfest(self):
jikimo_bom_ids = self.mapped('jikimo_bom_ids')
if not jikimo_bom_ids:
self._bom_mainfest()