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

How to show value of custom field in QWeb report ?

By
M.BEN
on 3/9/16, 5:21 AM 409 views

Hi.

I added a custom field named "Needed" in "budget.lines" in "Accounting>Budget".

I need to customize the QWeb report, by adding "Needed" field in the associated QWeb view :

    <thead>

    <tr>

    <th>Description</th>

    <th>Needed</th>

    <th class="text-right">Theoretical Amt</th>

    <th class="text-right">Planned Amt</th>

    <th class="text-right">Practical Amt</th>

    <th class="text-center">Perc(%)</th>

    </tr>

    </thead>  

So, when I try to show the value of this custom variable ('x_needed'), I get "500: Internal Server Error" :

    "x_needed" while evaluating

    "formatLang(line['x_needed'], dp='Account', currency_obj=res_company.currency_id)"

Can someone help me to solve this problem please :

    <tr t-foreach="funct(o, data['form'])" t-as="line">

     <td>

    <span style="color: white;" t-esc="'... '*(line['status'] - 1)"/>

    <span t-esc="line['name']"/>

    </td>

    <td>

    <span t-esc="formatLang(line['x_needed'], dp='Account', currency_obj=res_company.currency_id)"/>

    </td>

    <td class="text-right">

    <span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/>

    </td>  


Thank you in advance.

0
Krupesh Laiya
On 3/9/16, 7:45 AM

you need to override that report by using following:


 <report

id="account_budget.action_report_budget"

model="account.budget.post"

string="Budget"

report_type="qweb-pdf"

name="YOUR MODULE NAME.report_budget"

file="YOUR MODULE NAME.report_budget"

menu="False"

/>


pls try this if not working then kindly post your error.

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

1 follower(s)

Stats

Asked: 3/9/16, 5:21 AM
Seen: 409 times
Last updated: 3/9/16, 7:45 AM