Files
odoo_source/addons/product/tests/test_common.py
T
Victor Feyens be97280b82 [FIX] base,product,sale: currency checks in tests
Since https://github.com/odoo/odoo/commit/3752b3166ec6bbb5c6ea55f96bb521381bf2b2d9,
the currency of the test architecture is not fixed anymore to USD (but is by default).

Therefore, the nightly runbot tests of the localization (l10n_* modules) all fail
when verifying the company currency is USD (because the localization sets the company
currency to the country one).

This commit adapts those checks to stop enforcing the USD currency as base,
only enforcing that the currency used is the company one.

closes odoo/odoo#109807

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-12 19:09:00 +01:00

32 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import tagged
from odoo.addons.product.tests.common import ProductCommon
@tagged('post_install', '-at_install')
class TestProduct(ProductCommon):
def test_common(self):
self.assertEqual(self.consumable_product.type, 'consu')
self.assertEqual(self.service_product.type, 'service')
account_module = self.env['ir.module.module']._get('account')
if account_module.state == 'installed':
self.assertFalse(self.consumable_product.taxes_id)
self.assertFalse(self.service_product.taxes_id)
self.assertFalse(self.pricelist.item_ids)
self.assertEqual(
self.env['product.pricelist'].search([]),
self.pricelist,
)
self.assertEqual(
self.env['res.partner'].search([]).property_product_pricelist,
self.pricelist,
)
self.assertEqual(self.pricelist.currency_id.name, self.currency.name)
self.assertEqual(self.pricelist.discount_policy, 'with_discount')