I've asked this Question again, because i was not able to EDIT my question.
I'm having problem on overriding create method.
I've one2many field in my current model, I want to update the value of that field when new record created, and this one2many field's co-model has it's own one2many fields.
So, basically there is two levels of one2many fields.
My one2many field has one2many field, I want to create record for that model as well,
How can i achieve this?
Any help on this appreciated.
This is need to be done using api coding standard.
_name = 'main.model'
x_ids = fields.one2Many('sub.model','main_id',"Test")
_name = 'sub.model'
main_id = fields.Many2one('main.model', "Main Model")
xx_ids = fields.One2many('another.sub.model','sub_model_id',"Test")
_name = 'another.submodel'
sub_model_id = fields.Many2one('sub.model',"Sub Model")
#remaining fields..go here
Consider this is model structure, now when i create record of Class A model, I want to updated one2many field of Class B and Class B is having Class C one2many field, so how to update the values or create records with 2 level of one2many field? is there any option?
I am looking for the solution for both side create and write method. Please anyone has idea than it will be really helpful.