Skip to Content
Menu
This question has been flagged
2 Replies
897 Views

Hi, I'm trying to create a new tree view with vendor invoice information, but the information displays all the accounting entries of the 'account.move' model and I only want vendor invoices. I also want to export the information to xslx.
This is my xml code.

Thanks.



id="view_libro_compra" model="ir.ui.view">
name="name">Libro de iva compra
name="model">account.move
name="arch" type="xml">

string="Libro compra">
name="currency_id" invisible="1"/>
name="empty_field"/>
name="invoice_date"/>
name="name" string="Número de correlativo"/>
name="document_nrc"/>
name="partner_id" string="Nombre"/>
name="empty_field"/>
name="empty_field"/>
name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}"/>
name="empty_field"/>
name="amount_total" widget="monetary" options="{'currency_field': 'currency_id'}"/>
name="empty_field"/>







id="action_purchase_order_new" model="ir.actions.act_window">
name="name">Libro de iva compra4
name="res_model">account.move
name="view_mode">tree
name="view_id" ref="view_libro_compra"/>


id="menu_purchase_order_new"
name="Libro de iva compra4"
parent="account.menu_finance_payables"
action="action_purchase_order_new"/>


Avatar
Discard
Author Best Answer

I was able to solve the related fields and you are right, they are done with Python so the fields I need are already in the new tree view, the only thing I need is to add a filter that only shows the data from the vendor invoice.

Do you have any idea how to solve it?

Thanks

Avatar
Discard
Best Answer

Hi,
As far I know related field works in Python not in xml so either you need to create a new field in account.move model if you want to move forward with python related as follows

partner_vat = fields.Char('res.partner', related='partner_id.vat')

Or Either you can call it in xml file like this if the field you are looking for is with Many2one relation like in account.move partner field is with a relation of many2one so you can try it with following method and get all of its related table values 

name="partner_id.vat"/>



See if this will resolve your issue

If my answer help you please up vote 
If not clear or not solved let me know I will assist you
Thanks

Avatar
Discard
Related Posts Replies Views Activity
2
Dec 24
189
2
May 24
647
1
Mar 24
269
3
Mar 24
2517
1
Feb 23
976