Odoo Help


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

on 9/10/15, 9:30 AM 722 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')"/>




<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"/>




<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"/>


<div class="row mt32 mb32">


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


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


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


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


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

<strong>Invoice Date:</strong>

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






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')"

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/10/15, 9:30 AM
Seen: 722 times
Last updated: 9/10/15, 9:30 AM