mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
Merge pull request #8 from sunflowerit/9.0-mig-intrastat-base
[MIG] 9.0 intrastat_base
This commit is contained in:
@@ -62,6 +62,7 @@ Contributors
|
||||
|
||||
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
|
||||
* Luc De Meyer, Noviat <info@noviat.com>
|
||||
* Tom Blauwendraat, Sunflower IT <info@sunflowerweb.nl>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
||||
28
intrastat_base/__openerp__.py
Normal file
28
intrastat_base/__openerp__.py
Normal file
@@ -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,
|
||||
}
|
||||
@@ -4,7 +4,9 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo noupdate="1">
|
||||
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="base.main_partner" model="res.partner">
|
||||
<field name="vat">FR58441019213</field>
|
||||
@@ -23,5 +25,7 @@
|
||||
<field name="list_price">30</field>
|
||||
<field name="is_accessory_cost">True</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# 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__)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# © 2010-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# 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):
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# 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):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# © 2011-2014 Akretion (Alexis de Lattre <alexis.delattre@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 ResCountry(models.Model):
|
||||
|
||||
5
intrastat_base/tests/__init__.py
Normal file
5
intrastat_base/tests/__init__.py
Normal file
@@ -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
|
||||
25
intrastat_base/tests/intrastat_base_tests.py
Normal file
25
intrastat_base/tests/intrastat_base_tests.py
Normal file
@@ -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)
|
||||
@@ -4,7 +4,7 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
<!-- Add 'exclude_from_intrastat_if_present' on tax form view -->
|
||||
<record id="view_tax_form" model="ir.ui.view">
|
||||
@@ -17,5 +17,4 @@
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
© 2015-2016 Noviat (http://www.noviat.com/)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
<!-- Menu entries for Intrastat -->
|
||||
<menuitem id="menu_intrastat_base_root"
|
||||
name="Intrastat"
|
||||
parent="account.menu_finance_legal_statement"/>
|
||||
parent="account.menu_finance_reports"/>
|
||||
<menuitem id="menu_intrastat_config_root" name="Intrastat"
|
||||
parent="account.menu_finance_configuration" sequence="50"/>
|
||||
|
||||
@@ -29,5 +28,4 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
@@ -25,4 +25,4 @@
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
<!-- TODO: move to res.config page -->
|
||||
<record id="view_company_form" model="ir.ui.view">
|
||||
@@ -23,4 +23,4 @@
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
|
||||
<!-- Add intrastat field on res_country -->
|
||||
@@ -45,4 +45,4 @@
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
|
||||
<!-- Set country_id field to required on partner form view -->
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
@@ -22,4 +22,4 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user