Skip to content

[20.0][MIG] mail_activity_team: Migration to 20.0 - #1

Merged
alan196 merged 71 commits into
Jarsa:20.0from
Jarsa-dev:20.0-mig-mail_activity_team
Oct 10, 2026
Merged

alan196 merged 71 commits into
Jarsa:20.0from
Jarsa-dev:20.0-mig-mail_activity_team

Conversation

@alan196

@alan196 alan196 commented Oct 10, 2026

Copy link
Copy Markdown

Migration of mail_activity_team from 19.0 to 20.0 (history ported with oca-port).

Changes for 20.0

  • Security: ir.model.access.csv and the mail.activity record rule (write/unlink on activities of the user's teams) converted to security/ir.access.csv; the security XML only held that rule and was removed.
  • Systray (res.users._get_activity_groups): the core replaced its SQL with _divide_activities_in_groups / _format_activity_group. The team override now searches the team activities and reuses those helpers; _format_activity_group keeps the previous semantics of the badge (only urgent team activities not assigned to the current user). Access rules are now respected (the old SQL bypassed them).
  • mail.activity: _to_store_defaults -> _store_activity_fields; user_id is a computed field in 20.0 with a fallback to the current user, overridden so team activities can stay unassigned; the core _onchange_activity_type_id was removed (module onchange kept without super).
  • Signatures: activity_schedule(..., activity_user_id_fname), _determine_responsible(on_demand_responsible, on_demand_responsible_fname, applied_on_record, on_demand_role), _run_action_next_activity -> _run_action_next_activity_multi; _search_my_activity_date_deadline rewritten with Domain(... "any" ...) like the core.
  • Views: the activity popup and the schedule wizard use the new o_outlined layout (team fields added with the same pattern and Material icons); role_id is only required when neither a user nor a team is set; search filter anchor filter_user_id_uid -> filter_activities_my.
  • JS/OWL: proxy state instead of DOM manipulation in the systray patch, templates with this., imports from @mail/model/export; the team is shown next to the assignee and in the activity tooltip (mail.ActivityTooltip), since the expanded table of mail.Activity no longer exists.
  • activity_team_user_ids label "test field" -> "Activity Team Members".
  • Tests adapted: activity_format / triggered_next_type_id no longer exist, deadlines are computed from the activity type delay, BaseCommon now runs as a regular user by default.

Tests

  • -i mail_activity_team --test-enable --test-tags /mail_activity_team on a fresh database with demo data: 43 tests, 0 failed, 0 errors, no warnings/deprecations.
  • Manual browser check (temporary HttpCase, not committed): systray filters My/Team activities, team shown in the chatter activity and in its tooltip.
  • pre-commit of the repository passes.

Assisted-by: Claude Fable 5.1

JordiBForgeFlow and others added 30 commits October 10, 2026 07:24
Currently translated at 100.0% (24 of 24 strings)

Translation: social-13.0/social-13.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-mail_activity_team/it/
When an activity is scheduled due to automatic processes the onchanges
won't adapt the proper user team, so we could have a mismatch that
provokes an exceptions due to the designed constaints
- If a user is archived but there's an automatic activity, the team
check wouldn't locate him. We have to ensure the context.
- When the automatic activity gets a user with no team, we should set
the team to a void one as well.

TT30470
If you schedule an activity and you don't force the team as False, errors might araise.
For example, on holidays.
The user couldn't see the proper count of his own activities. It was
allways showing the team activities counter.

TT35885
Currently translated at 71.8% (23 of 32 strings)

Translation: social-15.0/social-15.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_activity_team/it/
alexey-pelykh and others added 27 commits October 10, 2026 07:24
A monkey patch is required on mail.activity's create method to prevent an
unboundError (see odoo/odoo#197864).

In order to open the team activities (Late/Today/Future) from the systray widget,
domain clause mangling is applied in mail.activity.mixin's web_search_read.

Includes OCA/social#1469 that was not ported to 17.0 yet.

Aligned ir.rule with upstream mail.activity rule wrt. creation
(https://github.com/odoo/odoo/blob/b1ffd68e4094d9456dd4ae8f0fa12b50e5ce9d67/addons/mail/security/mail_security.xml#L223-L232).

Co-authored-by: Wodran Van de Sande <wodran.vandesande@dynapps.be>
…s provided

mail.activity's `create` checks if a value for `team_id` is being passed, and
in that case drops values for `user_id`. However, a value for `team_id` will
always be present in the create values because there is a default method for
the field.

In case all teams have been deleted, or if team selection is restricted as per
customization, the value for `team_id` will still be present, but empty. In
that case, we don't want the value for `user_id` to be dropped silently from
the values.
mail_post_defer breaks tests for mail_tracking, so it's better to split it.
OCA/social@b782115
@moduon MT-10471
Currently translated at 100.0% (35 of 35 strings)

Translation: mail-18.0/mail-18.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_activity_team/it/
Currently translated at 100.0% (35 of 35 strings)

Translation: mail-18.0/mail-18.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_activity_team/it/
Currently translated at 100.0% (43 of 43 strings)

Translation: mail-18.0/mail-18.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_activity_team/it/
Migration changes:
- Bump version to 19.0.1.0.0
- Remove legacy 18.0 migrations directory
- Replace _() with self.env._() for 19.0 translation API
- Replace groups_id with group_ids (field renamed in 19.0)
- Rewrite _get_activity_groups to match 19.0 ORM-based API
  (replaces raw SQL with ORM search, per-record counting,
  access rights checks, and new return format with domain/view_type)
- Update JS: fetchData → fetchStoreData for 19.0 store API
- Replace self._context with self.env.context
- Update tests for new per-record counting semantics
- Remove obsolete migration test
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: mail-19.0/mail-19.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_activity_team/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: mail-19.0/mail-19.0-mail_activity_team
Translate-URL: https://translation.odoo-community.org/projects/mail-19-0/mail-19-0-mail_activity_team/
- Security: ir.model.access.csv and the mail.activity record rule
  (write/unlink on team activities) are now rows of security/ir.access.csv.
- res.users._get_activity_groups: rebuilt on top of the new core helpers
  _divide_activities_in_groups / _format_activity_group instead of raw
  SQL; the team badge still only counts urgent activities that are not
  assigned to the current user.
- mail.activity: _to_store_defaults -> _store_activity_fields. user_id is
  computed by the core in 20.0 (fallback to the current user): keep team
  activities unassigned instead. The core _onchange_activity_type_id was
  removed, the module onchange no longer calls super.
- Signatures adapted: activity_schedule (activity_user_id_fname),
  _determine_responsible, _run_action_next_activity_multi;
  _search_my_activity_date_deadline rewritten with Domain.
- Views: follow the o_outlined layout of the activity popup and of the
  schedule wizard, role_id is not required when a team is set, search
  filter anchor is now filter_activities_my.
- JS: proxy state instead of DOM manipulation in the systray patch,
  @mail/model/export imports, team shown next to the assignee and in the
  activity tooltip (templates use this.).
- Tests adapted: activity_format and triggered_next_type_id no longer
  exist, deadlines are computed from the activity type, teams can only be
  created by system users.

Assisted-by: Claude Fable 5.1
@jarsabot

Copy link
Copy Markdown
    **WARNING**: Could not link to Odoo task. Record ID not found in the title of the MR, supported formats:
{ record type }#{ number }

Available types: 'task#', 't#' (case insensitive)

Examples:

  • task#123

  • i#123

@alan196
alan196 merged commit 0efce3f into Jarsa:20.0 Oct 10, 2026
4 checks passed
alan196 pushed a commit that referenced this pull request Nov 30, 2026
[19.0][MIG] mail_gateway_whatsapp: review fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.