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 get the custom field value from Pay Invoice and add it in invoice

By
emmaswan
on 9/10/15, 9:30 AM 403 views

How to get the custom field value from Pay Invoice and add it in invoice report?

I have a custom field that is autoincrement under pay invoice but I there is an error when i try to add it in invoice. this is the code i added:

<template id="account.report_receiptdetails">

<t t-call="report.html_container">

<t t-foreach="doc_ids" t-as="doc_id">

<t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_receiptdetails_document')"/>

</t>

</t>

</template>

<template id="account.report_receiptdetails_document">

<t t-call="report.external_layout">

<div class="page">

<div class="row">

<div class="col-xs-5 col-xs-offset-7">

<address t-field="o.partner_id"

t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' />

<span t-field="o.partner_id.vat"/>

</div>

</div>

<h2>

<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Receipt</span>

<span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>

<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>

<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>

<span t-if="o.type == 'out_refund'">Refund</span>

<span t-if="o.type == 'in_refund'">Supplier Refund</span>

<span t-if="o.type == 'in_invoice'">Supplier Invoice</span>

<span t-field="o.number"/>

</h2>

<div class="row mt32 mb32">

</div>

<div class="col-xs-2" t-if="o.voucher_id.inc_num">

<strong>Number:</strong>

<p t-field="o.voucher_id.inc_num"/>

</div>

<div class="col-xs-2" t-if="o.name">

<strong>Description:</strong>

<p t-field="o.name"/>

</div>

<div class="col-xs-2" t-if="o.date_invoice">

<strong>Invoice Date:</strong>

<p t-field="o.date_invoice"/>

</div>

.....

</template>

</data>

</openerp>



the error that appear on the invoice is:

qwebexception: ""'account.invoice' object has no attribute 'voucher_id'" while evaluating

'o.voucher_id.inc_num'" while evaluating

"translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_receiptdetails_document')"

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: 9/10/15, 9:30 AM
Seen: 403 times
Last updated: 9/10/15, 9:30 AM