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.
Hello, I am developed a new module in Odoo 8, in which I have a Python class that not inherits from any other class. The code of the class is:
_name = 'product.pricelist.products_prices'
product_tmpl_id = fields.Many2one('product.template')
precio = fields.Float(digits=(8,2), String="Precio")
product_pricelist_item_id = fields.Many2one('product.pricelist.item')
I need to add a view of the class in the form view "product.pricelist.item.form". I want to put it in a new tab on the popup, but the new view is of model "product.pricelist.products_prices" and this model does not have the fields of product.pricelist.item so I get an error when I am installing the module... How can I do?
- create a one2many of the class 'product.pricelist.products_prices' with this field product_pricelist_item_id, in the class "product.pricelist.item" ,
- in the form view "product.pricelist.item.form", add the above one2many under <notebook><page>...</page></notebook>
Hope, this works for you.
Can you please tell what exact error you are getting before implementing this?
<field name="products_prices_ids" string="Producto" >
<field name="..." />
<field name="..." />
Thank you, that works.
But how can I specify the columns to show? I want to show a tree, and for example I want to show only the two first fields.
This works correctly: (products_prices_ids is the one2many relationship field)
<field name="products_prices_ids" string="Producto" />
But if I do this
<field name="products_prices_ids.product_tmpl_id" string="Producto" />
I get an error "field products_prices_ids.product_tmpl_id does not exist".
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: 12/9/14, 2:28 PM|
|Seen: 2155 times|
|Last updated: 6/23/16, 7:13 AM|