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

Amount in account_voucher

By
Jihen BEN ALI
on 8/18/15, 5:43 AM 216 views

Hi everyone,

I want to get the field amount in account_voucher and display it in a tree view so I had do as follow:

class reporting_checks(osv.osv):

_name='account.voucher'

_inherit='account.voucher'

_columns={

'voucher_id': fields.many2one('account.voucher', 'Journal'),

'input':fields.related('voucher_id','amount',type="float",relation="account.voucher",string="Input amount",store=True),

}

xml file:

<record model="ir.actions.act_window" id="action_reporting_caisse_checks">

<field name="name">Caisse</field>

<field name="res_model">account.voucher</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="view_id" ref="view_voucher_caisse_tree"/>

</record>

<record id="view_voucher_caisse_tree" model="ir.ui.view">

<field name="name">Caisse</field>

<field name="model">account.voucher</field>

<field name="arch" type="xml">

<form string="Caisse">

<field name="input"/>

</form>

</field>

</record>

But all I get in the tree view is a zero any suggestion how can I get the amount field from the account_voucher.

 

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: 8/18/15, 5:43 AM
Seen: 216 times
Last updated: 8/18/15, 5:43 AM