-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by feketemihai
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
l10n_ro_account_edi_ubl/migrations/16.0.1.83.1/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (C) 2025 NextERP Romania | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
import sys | ||
|
||
|
||
def install(package): | ||
try: | ||
__import__(package) | ||
except Exception: | ||
import subprocess | ||
|
||
subprocess.call([sys.executable, "-m", "pip", "install", package]) | ||
|
||
|
||
install("openupgradelib") | ||
|
||
try: | ||
from openupgradelib import openupgrade | ||
except ImportError: | ||
openupgrade = None | ||
|
||
|
||
@openupgrade.migrate(use_env=True) | ||
def migrate(env, version): | ||
|
||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE res_partner | ||
SET l10n_ro_edi_ubl_no_send_cnp = True | ||
FROM res_country | ||
WHERE res_partner.country_id = res_country.id | ||
AND res_country.code = 'RO' | ||
AND res_partner.is_company = False | ||
AND res_partner.parent_id IS NULL; | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters