Skip to content

Commit

Permalink
[FIX] cooperator: Set company on sequences in migration script
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <carmen@coopiteasy.be>
  • Loading branch information
carmenbianca committed Jun 13, 2023
1 parent faea516 commit 87e1575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cooperator/migrations/14.0.1.7.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
company = env.ref("base.main_company")
# Use the existing and already-in-use sequences for company 1.
if company:
# Set sequences on company and company on sequences
# First sequence
company.cooperator_subscription_sequence_id = env.ref(
"cooperator.sequence_subscription"
)
company.cooperator_subscription_sequence_id.company_id = company
# Second sequence
company.cooperator_register_operation_sequence_id = env.ref(
"cooperator.sequence_register_operation"
)
company.cooperator_register_operation_sequence_id.company_id = company
other_companies = env["res.company"].search([]) - company
other_companies._create_cooperator_sequences()

0 comments on commit 87e1575

Please sign in to comment.