19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:56 +01:00
parent a2f74aefd8
commit 4a4d12c333
844 changed files with 212348 additions and 270090 deletions

View file

@ -10,6 +10,7 @@ class TestProjectProfitabilityCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env.user.group_ids += cls.env.ref('project.group_project_manager')
cls.partner = cls.env['res.partner'].create({
'name': 'Georges',
@ -17,7 +18,6 @@ class TestProjectProfitabilityCommon(TransactionCase):
cls.analytic_plan = cls.env['account.analytic.plan'].create({
'name': 'Plan A',
'company_id': False,
})
cls.analytic_account = cls.env['account.analytic.account'].create({
'name': 'Project - AA',
@ -27,7 +27,7 @@ class TestProjectProfitabilityCommon(TransactionCase):
cls.project = cls.env['project.project'].with_context({'mail_create_nolog': True}).create({
'name': 'Project',
'partner_id': cls.partner.id,
'analytic_account_id': cls.analytic_account.id,
'account_id': cls.analytic_account.id,
})
cls.task = cls.env['project.task'].with_context({'mail_create_nolog': True}).create({
'name': 'Task',
@ -37,7 +37,19 @@ class TestProjectProfitabilityCommon(TransactionCase):
'revenues': {'data': [], 'total': {'invoiced': 0.0, 'to_invoice': 0.0}},
'costs': {'data': [], 'total': {'billed': 0.0, 'to_bill': 0.0}},
}
cls.foreign_currency = cls.env['res.currency'].create({
'name': 'Chaos orb',
'symbol': '',
'rounding': 0.001,
'position': 'after',
'currency_unit_label': 'Chaos',
'currency_subunit_label': 'orb',
})
cls.env['res.currency.rate'].create({
'name': '2016-01-01',
'rate': '5.0',
'currency_id': cls.foreign_currency.id,
})
class TestProfitability(TestProjectProfitabilityCommon):
def test_project_profitability(self):
@ -46,9 +58,8 @@ class TestProfitability(TestProjectProfitabilityCommon):
In this module, the project profitability should have no data.
So the no revenue and cost should be found.
"""
profitability_items = self.project._get_profitability_items(False)
self.assertDictEqual(
profitability_items,
self.project._get_profitability_items(False),
self.project_profitability_items_empty,
'The profitability data of the project should be return no data and so 0 for each total amount.'
)