Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1883 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 24
1397
3
thg 5 25
1504
2
thg 5 24
1977
1
thg 3 24
1320
3
thg 3 24
4192