Odoo Help

Welcome!

This community 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.

0

Access project' properties from invoice line in QWeb report

By
Raffaele
on 12/11/14, 6:09 AM 368 views

Hallo

I added a custom field to the project and I'd need to access it from within the invoice.

Which is the syntax to use in the t-field?

By using o.invoice_line[0].account_analytic_id.property_name I can print the value of property_name from the analytic account related to that invoice line, but I am not able to reach the related project, I tried things like:

o.invoice_line[0].account_analytic_id.project_id.property_name 

I tried another approach, without luck:
<span t-esc="self.pool.get('project.project').search([('analytic_account_id', '=', o.invoice_line[0].account_analytic_id.id)]).x_customfield" />

It fails with the error "'NoneType' object has no attribute 'pool'" since the QWeb renderer does not understand the "self" of "self.pool"

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 12/11/14, 6:09 AM
Seen: 368 times
Last updated: 3/16/15, 8:10 AM