Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] some imp #661

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openupgrade_framework/odoo_patch/odoo/addons/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import base
from . import account
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import chart_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.addons.account.models.chart_template import AccountChartTemplate


def ref(self, xmlid, raise_if_not_found=True):
"""Don't raise if record is not found which are common during migration."""
return AccountChartTemplate.ref._original_method(
self, xmlid, raise_if_not_found=False
)


ref._original_method = AccountChartTemplate.ref
AccountChartTemplate.ref = ref
35 changes: 0 additions & 35 deletions openupgrade_scripts/scripts/account/17.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging

from openupgradelib import openupgrade

from odoo import api, models

_logger = logging.getLogger(__name__)

_fields_renames = [
(
"res.company",
Expand Down Expand Up @@ -124,35 +118,6 @@
]


@api.model_create_multi
def create(self, vals_list):
"""Remove delete account.report.expression record that violates constraints
account_report_expression_line_label_uniq.
"""
if self._name != "account.report.expression":
return models.BaseModel.create._original_method(self, vals_list)

for vals in vals_list:
expression = self.search(
[
("report_line_id", "=", vals["report_line_id"]),
("label", "=", vals["label"]),
],
)
if expression:
_logger.warning(
"Delete obsolete account.report.expression record: %s",
str(expression.read([])),
)

expression.unlink()
return models.BaseModel.create._original_method(self, vals_list)


create._original_method = models.BaseModel.create
models.BaseModel.create = create


def _map_account_report_filter_account_type(env):
openupgrade.rename_columns(
env.cr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@


def _res_partner_fill_value(env):
partners = env["res.partner"].with_context(active_test=False).search([])
partners = (
env["res.partner"]
.with_context(active_test=False)
.search(
[
"|",
"|",
("country_id", "!=", False),
("vat", "!=", False),
("company_registry", "!=", False),
]
)
)
partners._compute_ubl_cii_format()
partners._compute_peppol_endpoint()
partners._compute_peppol_eas()
Expand Down
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/l10n_vn/17.0.2.0.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,17 @@ def _vn_coa_rename_xml_id(env):
@openupgrade.migrate()
def migrate(env, version):
_vn_coa_rename_xml_id(env)
# https://github.com/odoo/odoo/commit/f639de48eaee991b37bbaf8c62aecc4f425ea5e2
openupgrade.rename_xmlids(
env.cr,
[
(
"l10n_vn_viin.account_tax_report_line_purchase_val_exemption",
"l10n_vn.account_tax_report_line_04_02_01_vn",
),
(
"l10n_vn_viin.account_tax_report_line_sale_val_exemption",
"l10n_vn.account_tax_report_line_04_02_02_vn",
),
],
)
Loading