From 06630f9f090f2c93ba5dc5cf3995885d3fc209c8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 24 Apr 2013 10:55:14 +0200 Subject: [PATCH] Initial port to v7.0. Not tested a lot for the moment. --- intrastat_base/__init__.py | 4 +-- intrastat_base/__openerp__.py | 7 ++-- intrastat_base/country.py | 4 +-- intrastat_base/country_view.xml | 4 +-- intrastat_base/intrastat_common.py | 10 +++--- intrastat_base/intrastat_demo.xml | 8 ++--- intrastat_base/intrastat_menu.xml | 2 +- .../{partner_address.py => partner.py} | 13 ++++---- intrastat_base/product.py | 8 ++--- intrastat_base/product_view.xml | 32 +++++++------------ intrastat_base/tax.py | 6 ++-- intrastat_base/tax_view.xml | 4 +-- 12 files changed, 46 insertions(+), 56 deletions(-) rename intrastat_base/{partner_address.py => partner.py} (77%) diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 13ca149..c08cbac 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -23,6 +23,6 @@ import country import product import tax -import partner_address +import partner import intrastat_common diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 089173a..a817d0d 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -22,14 +22,15 @@ { - 'name': 'Base module for Intrastat reporting', + 'name': 'Intrastat Reporting Base', 'version': '1.1', 'category': 'Localisation/Report Intrastat', 'license': 'AGPL-3', + 'summary': 'Base module for Intrastat reporting', 'description': """This module contains the common functions for 2 other modules : - l10n_fr_intrastat_service : the module for the "Déclaration Européenne des Services" (DES) - l10n_fr_intrastat_product : the module for the "Déclaration d'Echange de Biens" (DEB) -This module is not usefull if it's not used together with one of those 2 modules. +This module is not usefull if it's not used together with one of those 2 modules or other country-specific intrastat modules. This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries. diff --git a/intrastat_base/country.py b/intrastat_base/country.py index 2542d72..38ae403 100644 --- a/intrastat_base/country.py +++ b/intrastat_base/country.py @@ -20,9 +20,9 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import osv, fields -class res_country(osv.osv): +class res_country(osv.Model): _inherit = 'res.country' _columns = { 'intrastat': fields.boolean('EU country', help="Set to True for all European Union countries."), diff --git a/intrastat_base/country_view.xml b/intrastat_base/country_view.xml index bf62fa3..87e7ec9 100644 --- a/intrastat_base/country_view.xml +++ b/intrastat_base/country_view.xml @@ -1,7 +1,7 @@ @@ -26,7 +26,7 @@ - + diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 8320b8a..622d3d2 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/). All rights reserved. +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). All rights reserved. # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,12 +20,12 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import osv +from openerp.tools.translate import _ from datetime import datetime from dateutil.relativedelta import relativedelta -from tools.translate import _ -class report_intrastat_common(osv.osv_memory): +class report_intrastat_common(osv.TransientModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products and services" @@ -115,7 +115,7 @@ class report_intrastat_common(osv.osv_memory): 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': 'current', - 'res_id': [attach_id], + 'res_id': attach_id, } return action diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/intrastat_demo.xml index d83640e..07c68ab 100644 --- a/intrastat_base/intrastat_demo.xml +++ b/intrastat_base/intrastat_demo.xml @@ -1,7 +1,7 @@ @@ -13,7 +13,7 @@ FR58441019213 - + BE0828696437 True @@ -23,7 +23,7 @@ True - + BE0884025633 True @@ -48,7 +48,7 @@ Shipping costs SHIP service - + 30 True diff --git a/intrastat_base/intrastat_menu.xml b/intrastat_base/intrastat_menu.xml index b078c6a..83434cb 100644 --- a/intrastat_base/intrastat_menu.xml +++ b/intrastat_base/intrastat_menu.xml @@ -1,7 +1,7 @@ diff --git a/intrastat_base/partner_address.py b/intrastat_base/partner.py similarity index 77% rename from intrastat_base/partner_address.py rename to intrastat_base/partner.py index f36329b..8ebe7ba 100644 --- a/intrastat_base/partner_address.py +++ b/intrastat_base/partner.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/) All Rights Reserved +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,16 +20,15 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import osv, fields -# We want to have the country field on res_partner_address always set +# We want to have the country field on res_partner always set # because the selection of invoices for intrastat reports is based -# on the country of the invoice partner address ! -class res_partner_address(osv.osv): - _inherit = 'res.partner.address' +# on the country of the invoice partner ! +class res_partner(osv.Model): + _inherit = 'res.partner' _columns = { 'country_id': fields.many2one('res.country', 'Country', required=True), } -res_partner_address() diff --git a/intrastat_base/product.py b/intrastat_base/product.py index c535a72..894dcbb 100644 --- a/intrastat_base/product.py +++ b/intrastat_base/product.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2012 Akretion (http://www.akretion.com/) All Rights Reserved +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,10 +20,10 @@ # ############################################################################## -from osv import osv, fields -from tools.translate import _ +from openerp.osv import osv, fields +from openerp.tools.translate import _ -class product_template(osv.osv): +class product_template(osv.Model): _inherit = "product.template" _columns = { 'exclude_from_intrastat': fields.boolean('Exclude from Intrastat reports', help="If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason."), diff --git a/intrastat_base/product_view.xml b/intrastat_base/product_view.xml index 28b026e..ba3d289 100644 --- a/intrastat_base/product_view.xml +++ b/intrastat_base/product_view.xml @@ -1,7 +1,7 @@ @@ -15,17 +15,12 @@ product.product - - - - - - - - + + + - - + + @@ -35,17 +30,12 @@ product.template - - - - - - - - + + + - - + + diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py index 4d12d32..209c2b5 100644 --- a/intrastat_base/tax.py +++ b/intrastat_base/tax.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,10 +20,10 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import osv, fields -class account_tax(osv.osv): +class account_tax(osv.Model): _inherit = "account.tax" _columns = { 'exclude_from_intrastat_if_present': fields.boolean('Exclude invoice line from intrastat if this tax is present', help="If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices."), diff --git a/intrastat_base/tax_view.xml b/intrastat_base/tax_view.xml index e60a327..c481490 100644 --- a/intrastat_base/tax_view.xml +++ b/intrastat_base/tax_view.xml @@ -17,8 +17,8 @@ - - + +