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

@ -5,10 +5,8 @@ from . import controllers
from . import models
from . import report
from . import wizard
from . import populate
from odoo import api, SUPERUSER_ID
from odoo.tools.sql import create_index
from odoo.tools.sql import create_index, make_identifier
def _check_exists_collaborators_for_project_sharing(env):
@ -22,22 +20,23 @@ def _check_exists_collaborators_for_project_sharing(env):
env['project.collaborator']._toggle_project_sharing_portal_rules(True)
def _project_post_init(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def _project_post_init(env):
_check_exists_collaborators_for_project_sharing(env)
# Index to improve the performance of burndown chart.
project_task_stage_field_id = env['ir.model.fields']._get_ids('project.task').get('stage_id')
create_index(
cr,
'mail_tracking_value_mail_message_id_old_value_integer_task_stage',
env.cr,
make_identifier('mail_tracking_value_mail_message_id_old_value_integer_task_stage'),
env['mail.tracking.value']._table,
['mail_message_id', 'old_value_integer'],
where=f'field={project_task_stage_field_id}'
where=f'field_id={project_task_stage_field_id}'
)
def _project_uninstall_hook(cr, registry):
# Create analytic plan fields on project model for existing plans
env['account.analytic.plan'].search([])._sync_plan_column('project.project')
def _project_uninstall_hook(env):
"""Since the m2m table for the project share wizard's `partner_ids` field is not dropped at uninstall, it is
necessary to ensure it is emptied, else re-installing the module will fail due to foreign keys constraints."""
env = api.Environment(cr, SUPERUSER_ID, {})
env['project.share.wizard'].search([("partner_ids", "!=", False)]).partner_ids = False