diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 65531ec..09c5424 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -62,6 +62,7 @@ Contributors * Alexis de Lattre, Akretion * Luc De Meyer, Noviat +* Tom Blauwendraat, Sunflower IT Maintainer ---------- diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index a0fdc10..cde864b 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -1,2 +1,3 @@ # -*- coding: utf-8 -*- + from . import models diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py new file mode 100644 index 0000000..8d2c791 --- /dev/null +++ b/intrastat_base/__openerp__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# © 2011-2016 Akretion (http://www.akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Intrastat Reporting Base', + 'version': '9.0.1.0.0', + 'category': 'Intrastat', + 'license': 'AGPL-3', + 'summary': 'Base module for Intrastat reporting', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'depends': ['base_vat'], + 'conflicts': ['report_intrastat'], + 'data': [ + 'data/country_data.xml', + 'views/product_template.xml', + 'views/res_partner.xml', + 'views/res_country.xml', + 'views/account_tax.xml', + 'views/res_company.xml', + 'views/intrastat.xml', + ], + 'demo': [ + 'demo/intrastat_demo.xml', + ], + 'installable': True, +} diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index f53d397..8834d34 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -4,7 +4,9 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + + + FR58441019213 @@ -23,5 +25,7 @@ 30 True + + + - diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index f9997fc..41d7285 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -2,7 +2,7 @@ # © 2011-2016 Akretion (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from openerp import models, fields class AccountTax(models.Model): diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index de3b04b..b32c9c8 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -2,8 +2,8 @@ # © 2010-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, tools, _ -from odoo.exceptions import UserError +from openerp import models, fields, api, tools, _ +from openerp.exceptions import UserError import logging logger = logging.getLogger(__name__) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 71cb987..9a4ef20 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -2,8 +2,8 @@ # © 2010-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError +from openerp import models, fields, api, _ +from openerp.exceptions import ValidationError class ProductTemplate(models.Model): diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index bec99ac..dc3d435 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- # © 2013-2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError +from openerp import models, fields, api, _ +from openerp.exceptions import ValidationError class ResCompany(models.Model): diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 19f34f2..b949538 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -2,7 +2,7 @@ # © 2011-2014 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from openerp import models, fields class ResCountry(models.Model): diff --git a/intrastat_base/tests/__init__.py b/intrastat_base/tests/__init__.py new file mode 100644 index 0000000..a2f5bfc --- /dev/null +++ b/intrastat_base/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2011-2016 Akretion (http://www.akretion.com). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import intrastat_base_tests diff --git a/intrastat_base/tests/intrastat_base_tests.py b/intrastat_base/tests/intrastat_base_tests.py new file mode 100644 index 0000000..eb93462 --- /dev/null +++ b/intrastat_base/tests/intrastat_base_tests.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# © 2016 Sunflower IT (http://sunflowerweb.nl). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp.tests.common import TransactionCase + +class TestIntrastatBase(TransactionCase): + """Tests for this module""" + + def test_10_countries(self): + # check if only EU countries have the 'intrastat' bit set + denmark = self.env.ref('base.dk') + self.assertTrue(denmark.intrastat) + kenya = self.env.ref('base.ke') + self.assertFalse(kenya.intrastat) + + def test_20_company(self): + # add 'Demo user' to intrastat_remind_user_ids + demo_user = self.env.ref('base.user_demo') + demo_company = self.env.ref('base.main_company') + demo_company.write({ + 'intrastat_remind_user_ids': [(6, False, [demo_user.id])] + }) + # then check if intrastat_email_list contains the email of the user + self.assertEquals(demo_company.intrastat_email_list, demo_user.email) diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index a1e72cd..e0d7f61 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + @@ -17,5 +17,4 @@ - - + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index b7cd9d6..d814fa5 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -4,13 +4,12 @@ © 2015-2016 Noviat (http://www.noviat.com/) License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - + + parent="account.menu_finance_reports"/> @@ -29,5 +28,4 @@ - - + diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 6440407..aa67f55 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + @@ -25,4 +25,4 @@ - + diff --git a/intrastat_base/views/res_company.xml b/intrastat_base/views/res_company.xml index c3d1f30..972099c 100644 --- a/intrastat_base/views/res_company.xml +++ b/intrastat_base/views/res_company.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + @@ -23,4 +23,4 @@ - + diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index e9dec05..de0cc65 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -4,7 +4,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + @@ -45,4 +45,4 @@ - + diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 7a9dfeb..8623d33 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -5,7 +5,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - + @@ -22,4 +22,4 @@ - +