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 want to add a field to a tree view in Odoo 9. In Odoo 8 I can do this searching where want I put the field with <xpath expr="//field[@name='price_subtotal']" position="replace"> but in Odoo 9 this not works. I can install my custom module OK but then fields is not displayed.
just to ensure, have you add in _openerp__.py your xml file and the module sale in the depends clausule?
the sintax you use is correct, but what view are you inheriting?
if you are inheriting a view of model sale.order.line it's correct, but price_subtotal also appears in tree view of model sale_order, in the one2many field order_line, so you have to do something like,
<xpath expr="//field[@name='order_line']/tree/field[@name='price_subtotal']" position="replace">
Hello, I have faced this serveral times. Personally, I solved this in 2 ways:
1. Don't type the code, yes, you have to be lazy, but don't type it your self, just copy code from some where you trust and paste in to your inherit view. Then edit things like 'price_subtotal'. This sounds crazy but I once spent the whole morning looked at my code, nothing's wrong, it just did not work and the log showed nothing. When i copy and paste, it worked like a charm.
2. Use new syntax:
<field name="price_subtotal" position="replace">
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: 9/12/16, 1:21 PM|
|Seen: 603 times|
|Last updated: 9/13/16, 8:02 AM|