CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I was looking at the example of the OpenERP tutorial:
And I'm trying to replicate it with my own fields:
'meeting_id': fields.many2one('event.meeting', 'Meeting', ondelete='cascade'),
But I'm getting this error:
However, the event I want to get in that field has 4 as its ID, so, what is happening? (the rows in the table event_meeting have a column named event_id, which is a many2one field pointing to the id of the table event_event).
Just make your related fields as like below.
'meeting_id': fields.many2one('event.meeting', 'Meeting' ),
'event_id': fields.related('meeting_id', 'event_id', type='many2one', relation='event.event', string='Event', readonly=True, store=True),
If you want to make realted fields for M2O then you have to give the relation of the last field, here 'event_id' is the last field so, you have to give the relation is 'event.event'.
I hope it will resolve your issue.
About This Community
Odoo Training Center
|Asked: 12/1/14, 11:42 AM|
|Seen: 4102 times|
|Last updated: 3/16/15, 8:10 AM|