Skip to content
Open
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
2 changes: 1 addition & 1 deletion docsource/modules180-190.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Module coverage 18.0 -> 19.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| base_address_extended |Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| base_automation | | |
| base_automation |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| base_geolocalize |Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2026 Tecnativa - Carlos Lopez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(env, "base_automation", "19.0.1.0/noupdate_changes.xml")
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2026 Tecnativa - Carlos Lopez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

from odoo.addons.base_automation.models.base_automation import TIME_TRIGGERS


def _precreate_base_automation_trg_date_range_mode(env):
openupgrade.add_columns(
env,
[
(
"base.automation",
"trg_date_range_mode",
"selection",
False,
"base_automation",
)
],
)
openupgrade.logged_query(
env.cr,
"""
UPDATE base_automation
SET trg_date_range_mode = NULL
WHERE trigger NOT IN %s
""",
(tuple(TIME_TRIGGERS),),
)
openupgrade.logged_query(
env.cr,
"""
UPDATE base_automation
SET trg_date_range_mode = CASE
WHEN trg_date_range < 0 THEN 'before'
ELSE 'after'
END
WHERE trigger IN %s
""",
(tuple(TIME_TRIGGERS),),
)
openupgrade.logged_query(
env.cr,
"""
UPDATE base_automation
SET trg_date_range = ABS(trg_date_range)
WHERE trg_date_range < 0 AND trigger IN %s
""",
(tuple(TIME_TRIGGERS),),
)


@openupgrade.migrate()
def migrate(env, version):
_precreate_base_automation_trg_date_range_mode(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---Models in module 'base_automation'---
---Fields in module 'base_automation'---
base_automation / base.automation / activity_ids (one2many) : NEW relation: mail.activity
base_automation / base.automation / message_follower_ids (one2many): NEW relation: mail.followers
base_automation / base.automation / message_ids (one2many) : NEW relation: mail.message
base_automation / base.automation / rating_ids (one2many) : NEW relation: rating.rating
base_automation / base.automation / website_message_ids (one2many): NEW relation: mail.message
# NOTHING TO DO: These fields are inherited from the mail.thread and mail.activity.mixin models.

base_automation / base.automation / previous_domain (char) : NEW hasdefault: default, stored: False
# NOTHING TO DO: New non-stored field used only in _onchange_domain.

base_automation / base.automation / trg_date_range_mode (selection): NEW selection_keys: ['after', 'before'], hasdefault: compute
# DONE: pre-migration: Pre-created and pre-computed field based on trigger field
# If trg_date_range is negative, it is set to before; otherwise, it is set to after.

base_automation / ir.actions.server / name (False) : DEL mode: modify
# NOTHING TO DO: The field is now a regular field instead of a computed one,
# but it remains stored, so the existing data is preserved.
# From now on, this field must be filled in explicitly by the user.

---XML records in module 'base_automation'---
NEW ir.ui.view: base_automation.view_server_action_form
DEL ir.ui.view: base_automation.ir_actions_server_view_form_automation
# NOTHING TO DO: Handled by ORM
Loading