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.