From 8c2d2ec9a2d3a0703d5f1c382cad0475096ff513 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Wed, 7 Mar 2012 16:41:56 +0530 Subject: [PATCH 1/2] [IMP] report_intrastat report are impoved removed address_invoice_id and address_contact_id bzr revid: jam@tinyerp.com-20120307111156-d3q9bonwwolutvmp --- addons/report_intrastat/report/invoice.rml | 10 +++++----- addons/report_intrastat/report_intrastat.py | 5 ++--- .../report_intrastat/test/report_intrastat_report.yml | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) 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 - From f974b1c1bde31720ad2c56fae4de39328377a2cb Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Wed, 7 Mar 2012 17:15:26 +0530 Subject: [PATCH 2/2] [FIX] removed redudent fields in test case bzr revid: jam@tinyerp.com-20120307114526-872u4021dg5mjvf6 --- addons/report_intrastat/test/report_intrastat_report.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/report_intrastat/test/report_intrastat_report.yml b/addons/report_intrastat/test/report_intrastat_report.yml index 82c92c9e7e6..e049c0ffcb8 100644 --- a/addons/report_intrastat/test/report_intrastat_report.yml +++ b/addons/report_intrastat/test/report_intrastat_report.yml @@ -4,7 +4,6 @@ !record {model: account.invoice, id: test_invoice_1}: currency_id: base.EUR company_id: base.main_company - partner_id: base.res_partner_address_tang partner_id: base.res_partner_asus state: draft type: out_invoice