Hi ! I'm on Odoo (v8).
I have two models, declared like this:
class bar(models.Model):
_name = 'foo.bar'
_order = 'name'name = fields.Char()
quz = fields.Many2many(comodel_name='foo.quz')@api.model
def get_records(self, bar_id):bar_record = self.browse(bar_id)
return bar_record.quzclass quz(models.Model):
_name = 'foo.quz'
_order = 'name'name = fields.Char(
Whenever I call the function foo.bar.get_records(1), I get the error I wrote in the title.
Any idea how to solve this ?
Obviously, this is a simplified code, but the real code is not bigger.
I tried self.browse(1).quz, self.env['foo.bar'].browse(1).quz, with no more luck.
The records are in the database, I checked using psql. I really don't know how to access to these records.
I also tried change the name of the relational field. But that doesn't work neither.
Another idea, explanation ?