From 481001d4a6064c8a0eb970e530a2f612b7ad9bb7 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 23 Apr 2013 15:39:08 +0200 Subject: [PATCH] IMPORTANT CHANGE : - All EU countries should now be intrastat=True, including your own country - When generating lines for Intrastat Product/Service, all invoices for which country == Company's country are excluded --- intrastat_base/country_data.xml | 55 ++++++++++++++++-------------- intrastat_base/intrastat_common.py | 8 ++--- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/intrastat_base/country_data.xml b/intrastat_base/country_data.xml index 228c0b4..04fb439 100644 --- a/intrastat_base/country_data.xml +++ b/intrastat_base/country_data.xml @@ -2,83 +2,86 @@ + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 6d7e47b..8320b8a 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -60,10 +60,10 @@ class report_intrastat_common(osv.osv_memory): def _check_generate_lines(self, cr, uid, intrastat, context=None): - if not intrastat.company_id.currency_id.code: - raise osv.except_osv(_('Error :'), _("The currency code is not set on the currency '%s'.") %intrastat.company_id.currency_id.name) - if not intrastat.currency_id.code == 'EUR': - raise osv.except_osv(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") %intrastat.currency_id.code) + if not intrastat.company_id.country_id: + raise osv.except_osv(_('Error :'), _("The country is not set on the company '%s'.") %intrastat.company_id.name) + if not intrastat.currency_id.name == 'EUR': + raise osv.except_osv(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") %intrastat.currency_id.name) return True