Skip to Content
Menu
This question has been flagged
1 Reply
2956 Views

Dear,

As i am creating a module which need multiple table data should be saved and updated at a single shot.. that is if any one fail... no data should insert into no table. that is the condition.


i want to implement it in create method of the model class... It is implemented.


But create provide only dict 'vals'


how i integrate all table value to this dict as per the procedure (0,0,vals)


But standard implementation not working at all


Avatar
Discard
Best Answer

This is the 

@api.model
    def create(self, vals):
        -----------------------------------------------------
        -----------------------------------------------------
        self.evn['model1.model'].create(vals)
        return super(ClassName1, self).create(vals)

in this vals is a dictionary, we can chenge the values as you like,
{

'name': 'name',

'force': '1'

}

we can change the dict keywords and call the second create method from there. 

Avatar
Discard