콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1980 화면

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


아바타
취소
작성자 베스트 답변

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

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
2
12월 24
1495
3
5월 25
1646
2
5월 24
2095
1
3월 24
1406
3
3월 24
4373