I want to in every time I created a data on One2many field, at the same time I want it to save as data on my maintenance.equipment. I try to find the solution on other module in addons but i didn't yet find the answer.
The scenario is, before validating the shipment in my product, I need to input serial number on it. Each serial number I created to that product at the same time serves as my equipment name.
and that serial number which is sample1010, I need it to become my equipment name in module maintenance.equipment. I expected it to display here in my equipment.
All i taught is only i need to do is creating Many2one and One2many fields like this
class StockPackOperation(models.Model):
_inherit = 'stock.pack.operation'
lines_ids = fields.One2many('maintenance.equipment', 'lines_id')
sample = fields.Char(string="Sample")
class MaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
lines_id = fields.Many2one('stock.pack.operation')
but nothings happen. Any help or suggestion or advice please. I need to do this. Thanks in advice masters. Anw I am new in odoo.