Ported from odoo10 to odoo9

This commit is contained in:
kiplangatdan
2016-11-30 18:16:28 +03:00
parent ac98769d69
commit 75f135d246
2 changed files with 24 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<openerp>
<data noupdate="1">
<record id="base.fr" model="res.country">
<field name="intrastat" eval="True"/>
@@ -85,5 +86,5 @@
<record id="base.hr" model="res.country">
<field name="intrastat" eval="True"/>
</record>
</odoo>
</data>
</openerp>

View File

@@ -7,7 +7,7 @@ class TestIntrastatBase(TransactionCase):
def setUp(self):
super(TestIntrastatBase, self).setUp()
self.tax_intrastat = self.env["account.tax"]
def test_10_countries(self):
# check if only EU countries have the 'intrastat' bit set
@@ -15,6 +15,10 @@ class TestIntrastatBase(TransactionCase):
self.assertTrue(france.intrastat)
brazil = self.env.ref('base.br')
self.assertFalse(brazil.intrastat)
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
@@ -27,6 +31,21 @@ class TestIntrastatBase(TransactionCase):
self.assertEquals(demo_company.intrastat_email_list, demo_user.email)
def test_exclude_intrastat(self):
# Test if exclude_from_intrastat_if_present is false
exclude_tax = self.env['account.tax'].search([('id', '=', 1)])
for item in exclude_tax:
self.assertFalse(item.exclude_from_intrastat_if_present)
def test_accessory_cost(self):
accessory_cost = self.env['product.product'].search([('id', '=', 1)])
for test in accessory_cost:
self.assertFalse(test.is_accessory_cost)