[CLN] onboarding: remove multiple progress records precaution

As we prevented creating multiple records in beaae001 and cleaned the
databases for existing records in odoo/upgrade#4142, we can now safely
remove these checks.

Follow-up of Task-3101666
Task-3025136

Part-of: odoo/odoo#104223
This commit is contained in:
Florian Charlier
2023-06-30 23:37:49 +02:00
parent 865e1ce376
commit afe71fbd3c
2 changed files with 0 additions and 4 deletions
@@ -43,8 +43,6 @@ class Onboarding(models.Model):
current_progress_id = onboarding.progress_ids.filtered(
lambda progress: progress.company_id.id in {False, self.env.company.id})
if current_progress_id:
if len(current_progress_id) > 1:
current_progress_id = current_progress_id.sorted('create_date', reverse=True)[0]
onboarding.current_onboarding_state = current_progress_id.onboarding_state
onboarding.current_progress_id = current_progress_id
onboarding.is_onboarding_closed = current_progress_id.is_onboarding_closed
@@ -54,8 +54,6 @@ class OnboardingStep(models.Model):
if step in existing_progress_steps.step_id:
current_progress_step_id = existing_progress_steps.filtered(
lambda progress_step: progress_step.step_id == step)
if len(current_progress_step_id) > 1:
current_progress_step_id = current_progress_step_id.sorted('create_date', reverse=True)[0]
step.current_progress_step_id = current_progress_step_id
step.current_step_state = current_progress_step_id.step_state
else: