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.
The Question has been closedby
In model stock.move we have prodlot_id that has a many2one relation to stock.production.lot. Then we have the table stock.move.tree that has a field
< field name="prodlot_id"> groups="stock.group_production_lot"/>
But it actually shows the name from inside stock.production.lot.Where does this mapping happen? what if I want to show stock_available from inside stock.production.lot as a field? How can I do that?
field name="prodlot_id.stock_available" does not work
Hello Eikos Quinn,
This all thing works on field
Thing is that
many2one field shows the value of
name field. In your case
prodlot_id is a many2one of
stock.production.lot object and it shows the value of
It is recommended that your object should have
name field. If you don't want to put
name field then you should use any field for
_rec_name: Name of the field in which the name of every resource is stored. Default value: 'name'. Note: by default, the name_get method simply returns the content of this field.
For _rec_name refer: Link m2o field to a specific field in another class.
Now, as per your requirement/question there are two options.
1: You inherit 'stock.production.lot' and give
2: I would suggest you to create a
related field of
stock_available of object 'stock.production.lot' in
'stock_available': fields.related('prodlot_id', 'stock_available', string='Stock Available')
Hope this will help you.
Serpent Consulting Services
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: 11/14/13, 12:17 PM|
|Seen: 4257 times|
|Last updated: 3/16/15, 8:10 AM|