Odoo Help


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.


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

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

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)


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