Skip to content

Commit

Permalink
[MIG] account_credit_control: Migrate patch
Browse files Browse the repository at this point in the history
Adapt imported patch OCA#86 to v13.

@Tecnativa TT24841
  • Loading branch information
Jairo Llopis authored and fredzamoabg committed Jan 31, 2022
1 parent c1dea38 commit 708a8f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

from openupgradelib import openupgrade

from odoo.tools.parse_version import parse_version


@openupgrade.migrate()
def migrate(env, version):
# Skip migration if 12.0.3 was already installed (migration was already run)
if parse_version("12.0.3.0.0") <= parse_version(version) < parse_version("13.0"):
return
# Update mail.template records for credit.control.communication
communication_model = env.ref(
"account_credit_control.model_credit_control_communication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@

from openupgradelib import openupgrade

from odoo.tools.parse_version import parse_version


@openupgrade.migrate()
def migrate(env, version):
# Skip migration if 12.0.3 was already installed (migration was already run)
if parse_version("12.0.3.0.0") <= parse_version(version) < parse_version("13.0"):
return
# Preserve mail_message_id historic data from credit.control.line records
mail_message_legacy = openupgrade.get_legacy_name("mail_message_id")
openupgrade.copy_columns(
Expand Down

0 comments on commit 708a8f7

Please sign in to comment.