I have two one2many field which is reffering to a single model, existing in different models.
ie,
class modelA(models.Model):
_name = 'modela'
fila = fields.One2many('main','refa')
class moddelB(models.Model):
_name = 'modelb'
filb = fields.One2many('main','refb')
class main(models.Model):
_name = 'main'
name = fields.Char('Name')
date = fields.Date('Date')
refa = fields.Many2one('modela')
refb = fields.Many2one('modelb')
I will create records in modela. In this model there is a button is there. On clicking on that button i need to copy all values of fila field to filb field of modelb . How can i do that.