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.
Inside model account.invoice.line, there is only available line.name, which joins product_id, product name and product description. These fields can not be accessed separately so far. I only want to display product.name_template at printed invoices. Product_ID and description should only be for internal purposes.
Could anybody give me any example code? I am familiar with developing, but unfortunately not with python and I do not have any practical experience with ORM either. I have already inherited some classes to add some custom fields, but up to now, I have never stepped over the horizon of the data model I want to extend. In this case, account.invoice.line "knows" her product_id, but I have no idea how to get from this to my desired field.
For example, I saw code like that:
self.pool.get('product_product').browse(cr, uid, id).name_template
Is this sufficient to fetch all name_templates for every invoice.line and then store it to the table? To see some code related to my problem in entire context would be very helpful to me...
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: 1/12/14, 9:38 AM|
|Seen: 1864 times|
|Last updated: 3/16/15, 8:10 AM|