Monday, April 24, 2023
4 changes · master
Resolved issues and error corrections
This fixes an internal compatibility issue so Odoo continues to run correctly on Python 3.7, which is still a supported version. The change prevents a crash in core data handling by using an approach that works across supported Python versions.
Original PR description
Our minimal Python version is still Python3.7 `reversed(annoted_groupby.items())` doesn't work in Python3.7 because `dict_items` are not reversible in this version (only available in Python3.8 : https://docs.python.org/3/whatsnew/3.8.html#other-language-changes). Convert into list before `reversed` to be compatible in Python3.7
Clicking a reply backlink from the starred mailbox now either takes users to the original open conversation or shows a clear warning when it cannot. This prevents confusing dead clicks and helps users follow message context more reliably.
Original PR description
**Current behavior before PR:** Nothing happens when you click on the message backlink in the starred mailbox. **Desired behavior after PR is merged:** If the origin channel is open then the user will be redirected or a warning notification will be displayed. Task-2939118 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change fixes issues that could cause errors or warning notifications when users grouped records in list or reporting views. It improves reliability for grouped calendar views and other reports that group by the same linked field more than once.
Original PR description
### [FIX] core: read_group same relational grouping Before 916c9c4, we could groupby several times on the same relational fields for a `read_group` call. Example: `read_group([], [...],…
### [FIX] core: read_group same relational grouping
Before 916c9c4, we could
groupby several times on the same relational fields for a
`read_group` call. Example:
`read_group([], [...], groupby=['product_id', 'product_id'], ...)`.
Now, it produces a traceback:
File "/data/build/odoo/odoo/models.py", line 2583, in read_group
self._read_group_format_result(rows_dict, lazy_groupby)
File "/data/build/odoo/odoo/models.py", line 2396, in _read_group_format_result
ids = [row[group].id for row in rows_dict if row[group]]
File "/data/build/odoo/odoo/models.py", line 2396, in <listcomp>
ids = [row[group].id for row in rows_dict if row[group]]
AttributeError: 'tuple' object has no attribute 'id'
It is because `_read_group_format_result` try to convert the record
into tuple (id, display_name) twice (one for each groupby).
Fix this issue introduced by the refactor of `_read_group`.
### [FIX] calendar: groupby on calendar.event triggers 'danger' notification
The `read_group` of `calendar.event` sends a danger notification when
the user groups by any field in the list view. It is because the
security reenforcement done in 2c0b3ab
is too strict. It checks all `fields`, even the ones that are filtered
out by the `read_group` (`fields` without aggregation specification
nor `group_operator`).Marketing automation campaigns now correctly record participant values even when a campaign has no grouped activity data. This prevents missing or blank participant information and keeps campaign reporting reliable.
Original PR description
on defaultdict in _compute_participants This solves an issue with _compute_participants not setting any value if a campaign wasn't present in the return of a _read_group. We recently started using a defaultdict when adapting to the improved _read_group method at https://github.com/odoo/enterprise/commit/0a24c01ec178984df032710b81d562366c016ebb defaultdict will not add new entries when using the `get` method. It will instead return None like a regular dict. We just replace .get with directly addressing the element. task-3284558