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...
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/12/14, 9:38 AM|
|Seen: 1510 times|
|Last updated: 3/16/15, 8:10 AM|