I looked at different forum posts but I don't see a fix. I have 2 custom models that are in a relation One2many. One the many side I have a few related fields just for displaying the data in the view. Now if I change a value on the One side model that is related to the many side model I get the Expected singleton: my_custom_model_many(id1, id2, id3).
How can I fix this? I tough to make create and write methods @api.multi and then iterate with "for rec in self:" but they have return statements so the methods would finish in the first iteration.
If anyone has any suggestions with maybe a code example, that would be very appreciated!
class my_custom_module_one(models.Model): _name = 'my.custom.one' month = fields.Char() date_from = fields.Date() date_to = fields.Date() many_ids = fields.One2many('my.custom.many', 'one_id') class my_custom_module_many(models.Model): _name = 'my.custom.many' one_month = fields.Char(related='one_id.month') one_date_form = fields.Date(related='one_id.date_from') one_date_to = fields.Date(related='one_id.date_to') one_id = fields.Many2one('my.custom.one')
Can you update the question with your code and with the error message
Can't update the question... get only 403 forbidden page.
I have updated the question with what you have put as answer, by with this code there will not be any issues, I think you may have written some other functions in it