Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have simple database which has 3 models as follows
1- camps (to store Camps master data)
2- players (to store players master data)
3- players_camps (to store camps each player has attended)
the code for all models as follows:
_name = 'camps'
name = Char('Name')
organizer = Char()
date_from = Date('From date')
date_to = Date('To date')
place = Char()
supervisor = Char()
notes = Text()
_name = 'player'
name = Char()
camps = One2many('player_camps', 'player')
_name = 'player_camps'
camp = Many2one('camps', on_delete='CASCADE', on_update='CASCADE')
organizer = Many2one('camps', on_delete='CASCADE', on_update='CASCADE')
place = Many2one('camps', on_delete='CASCADE', on_update='CASCADE')
date_from = Many2one('camps', on_delete='CASCADE', on_update='CASCADE')
date_to = Many2one('camps', on_delete='CASCADE', on_update='CASCADE')
result = Integer(default=0)
when I display players camps (using One2many widget in the view ) I can see only the camp name but the other data
like organizer or place (which are stored in master model of camps) not shown
how can I show this data in the tree view of the players camps view ?
For Display all fields of one2many model you can set one2many field by this way that is describe below into form view of player model.
I think you was forgot to write may2one of player model in player_camps mode. because you have add one2many field in player name camps for this field relate with player model with its player field. i think here i was missing.
Hope this helps.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/15/16, 1:44 PM|
|Seen: 851 times|
|Last updated: 7/16/16, 3:17 PM|