Skip to content

Commit

Permalink
Merge pull request #478 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/commission (15.0)
  • Loading branch information
bt-admin authored Aug 8, 2024
2 parents 93c7e3f + 3c3cea9 commit 51fa7f4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions account_commission/migrations/15.0.2.0.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
"""Fill new invoice_agent_line_id many2one from the old many2many agent_line
equivalent table. This table always contain only one record on standard use.
"""
openupgrade.logged_query(
env.cr,
"""
UPDATE commission_settlement_line csl
SET invoice_agent_line_id = agent_line_id
FROM settlement_agent_line_rel rel
WHERE rel.settlement_id = csl.id
""",
)

0 comments on commit 51fa7f4

Please sign in to comment.