mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[MIG] base_global_discount: Migration to 13.0
[UPD] Update base_global_discount.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: server-backend-13.0/server-backend-13.0-base_global_discount Translate-URL: https://translation.odoo-community.org/projects/server-backend-13-0/server-backend-13-0-base_global_discount/
This commit is contained in:
committed by
ferran-73
parent
1a58090181
commit
6d03cff6ac
36
base_global_discount/migrations/13.0.1.0.0/post-migration.py
Normal file
36
base_global_discount/migrations/13.0.1.0.0/post-migration.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openupgradelib import openupgrade
|
||||
|
||||
|
||||
@openupgrade.migrate()
|
||||
def migrate(env, version):
|
||||
openupgrade.logged_query(
|
||||
env.cr,
|
||||
"""
|
||||
INSERT INTO customer_global_discount_rel
|
||||
(partner_id, global_discount_id)
|
||||
SELECT
|
||||
partner_id,
|
||||
global_discount_id
|
||||
FROM
|
||||
global_discount_res_partner_rel
|
||||
WHERE
|
||||
discount_scope = 'sale';
|
||||
""",
|
||||
)
|
||||
openupgrade.logged_query(
|
||||
env.cr,
|
||||
"""
|
||||
INSERT INTO supplier_global_discount_rel
|
||||
(partner_id, global_discount_id)
|
||||
SELECT
|
||||
partner_id,
|
||||
field_id
|
||||
FROM
|
||||
global_discount_res_partner_rel
|
||||
WHERE
|
||||
discount_scope = 'purchase';
|
||||
""",
|
||||
)
|
||||
Reference in New Issue
Block a user