Files
test/sf_tool_management/models/maintenance_equipment.py

16 lines
483 B
Python

from odoo import models, api
class SfMaintenanceEquipmentTool(models.Model):
_inherit = 'maintenance.equipment.tool'
@api.model_create_multi
def create(self, vals_list):
tools = super().create(vals_list)
for tool in tools:
self.env['sf.machine.table.tool.changing.apply'].sudo().create({
'maintenance_equipment_id': tool.equipment_id.id,
'cutter_spacing_code_id': tool.id
})
return tools