Skip to content

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

Open
alan196 wants to merge 71 commits into
OCA:20.0from
Jarsa-dev:20.0-mig-mail_activity_team
Open

alan196 wants to merge 71 commits into
OCA:20.0from
Jarsa-dev:20.0-mig-mail_activity_team

Conversation

@alan196

@alan196 alan196 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Migration of mail_activity_team to 20.0 (standard migration: version bump, no migrations/ folder).

Adaptations to Odoo 20.0:

  • Access rights moved to security/ir.access.csv; the former "my team" record rule (write/unlink on the activities of the user's teams) is now a row with operation=ud and the domain [('team_id', 'in', user.activity_team_ids.ids)].
  • res.users._get_activity_groups: the core no longer uses SQL, so the override is rewritten on top of _divide_activities_in_groups and _format_activity_group, keeping the badge semantics (urgent team activities not assigned to the current user) and respecting access rules.
  • mail.activity.user_id is now computed with a fallback to the current user: _compute_user_id is overridden so team activities may stay unassigned; role_id is only required when there is neither user nor team.
  • Store API: _to_store_defaults → _store_activity_fields; activity_format() is gone (tests use Store().add(...)).
  • New signatures of activity_schedule (activity_user_id_fname), _determine_responsible (on_demand_responsible_fname, on_demand_role), _run_action_next_activity_multi; _search_my_activity_date_deadline with Domain(..., "any", ...).
  • Views: activity popup and plan wizard follow the new o_outlined layout with Material icons; filter_user_id_uid → filter_activities_my; the wizard team domain uses res_model_ids.model.
  • JS/Owl: useRef + DOM class toggling replaced by proxy state and t-att-class; the team is shown next to the assignee and in the activity tooltip.
  • Tests adapted to the test user of BaseCommon (_test_user_groups) and to the removal of triggered_next_type_id.

Tests: 43 tests, 0 failed, 0 errors on a fresh 20.0 database with demo data; systray filters, chatter and tooltip also checked in a headless browser. pre-commit 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/
HviorForgeFlow and others added 26 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 <[email protected]>
…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
@OCA-git-bot OCA-git-bot added mod:mail_activity_team Module mail_activity_team series:20.0 labels Oct 12, 2026

@CRogos CRogos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todos:

  • Squash commits according to migration guide
  • Add missing PRs: #346

It would also be great if you could review the 19.0 migration #170 and #169 so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:mail_activity_team Module mail_activity_team series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.