diff --git a/contract/__manifest__.py b/contract/__manifest__.py index 54250c1c..4f55ea07 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Contracts Management - Recurring', - 'version': '10.0.4.3.0', + 'version': '10.0.4.3.1', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/tests/test_contract.py b/contract/tests/test_contract.py index 399dcc2c..90305abf 100644 --- a/contract/tests/test_contract.py +++ b/contract/tests/test_contract.py @@ -9,9 +9,30 @@ from odoo.tests import common class TestContractBase(common.SavepointCase): + + post_install = True + at_install = False + @classmethod def setUpClass(cls): super(TestContractBase, cls).setUpClass() + # Make sure a sale journal is present for tests + sequence_model = cls.env['ir.sequence'] + contract_sequence = sequence_model.create({ + 'company_id': cls.env.user.company_id.id, + 'code': 'contract', + 'name': 'contract sequence', + 'number_next': 1, + 'implementation': 'standard', + 'padding': 3, + 'number_increment': 1}) + journal_model = cls.env['account.journal'] + journal_model.create({ + 'company_id': cls.env.user.company_id.id, + 'code': 'contract', + 'name': 'contract journal', + 'sequence_id': contract_sequence.id, + 'type': 'sale'}) cls.partner = cls.env.ref('base.res_partner_2') cls.product = cls.env.ref('product.product_product_2') cls.product.taxes_id += cls.env['account.tax'].search( @@ -286,10 +307,14 @@ class TestContract(TestContractBase): line = self._add_template_line() line.product_id.description_sale = 'Test' line._onchange_product_id() - self.assertEqual(line.name, - '\n'.join([line.product_id.name, - line.product_id.description_sale, - ])) + # Make sure we use same language settings as in tested code: + product = line.product_id.with_context( + lang=self.partner.lang, + partner=self.partner.id) + product_name = product.name_get()[0][1] + self.assertEqual( + line.name, + '\n'.join([product_name, line.product_id.description_sale])) def test_contract_count(self): """It should return contract count."""