diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml index 497fa6b44ba..f12bf83adfa 100644 --- a/addons/report_intrastat/report/invoice.rml +++ b/addons/report_intrastat/report/invoice.rml @@ -142,12 +142,12 @@ [[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] - [[ o.address_invoice_id and display_address(o.address_invoice_id) ]] + [[ o.partner_id and display_address(o.partner_id) ]] - Tel. : [[ (o.address_invoice_id and o.address_invoice_id.phone) or removeParentNode('para') ]] - Fax : [[ (o.address_invoice_id and o.address_invoice_id.fax) or removeParentNode('para') ]] + Tel. : [[ (o.partner_id and o.partner_id.phone) or removeParentNode('para') ]] + Fax : [[ (o.partner_id and o.partner_id.fax) or removeParentNode('para') ]] VAT : [[ (o.partner_id and o.partner_id.vat) or removeParentNode('para') ]] @@ -184,7 +184,7 @@ [[ formatLang(o.date_invoice,date=True) ]] - [[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]] + [[ (o.partner_id and o.partner_id.ref) or ' ' ]] @@ -398,4 +398,4 @@ - \ No newline at end of file + diff --git a/addons/report_intrastat/report_intrastat.py b/addons/report_intrastat/report_intrastat.py index ffe90b54d4f..5a0c31bbdcc 100644 --- a/addons/report_intrastat/report_intrastat.py +++ b/addons/report_intrastat/report_intrastat.py @@ -112,10 +112,9 @@ class report_intrastat(osv.osv): left join product_uom uom on uom.id=inv_line.uos_id left join product_uom puom on puom.id = pt.uom_id left join report_intrastat_code intrastat on pt.intrastat_id = intrastat.id - left join (res_partner_address inv_address + left join (res_partner inv_address left join res_country inv_country on (inv_country.id = inv_address.country_id)) - on (inv_address.id = inv.address_invoice_id) - + on (inv_address.id = inv.partner_id) where inv.state in ('open','paid') and inv_line.product_id is not null diff --git a/addons/report_intrastat/test/report_intrastat_report.yml b/addons/report_intrastat/test/report_intrastat_report.yml index 2c85007e70c..82c92c9e7e6 100644 --- a/addons/report_intrastat/test/report_intrastat_report.yml +++ b/addons/report_intrastat/test/report_intrastat_report.yml @@ -4,13 +4,12 @@ !record {model: account.invoice, id: test_invoice_1}: currency_id: base.EUR company_id: base.main_company - address_invoice_id: base.res_partner_address_tang + partner_id: base.res_partner_address_tang partner_id: base.res_partner_asus state: draft type: out_invoice account_id: account.a_recv name: Test invoice 1 - address_contact_id: base.res_partner_address_tang - In order to test the PDF reports defined using report_intrastat module, we print a Intrastat Report -