Daily updates from Odoo
Friday, May 2, 2025
5 changes · saas-18.3
Miscellaneous changes
We never took the 'cumulated_start' option of an Odoo chart into account and instead relied on 'cumulative' but the options are not linked neither one implied by the other. Task-4701303 Forward-Port-Of: odoo/enterprise#84515 Forward-Port-Of: odoo/enterprise#82954
Original PR description
We never took the 'cumulated_start' option of an Odoo chart into account and instead relied on 'cumulative' but the options are not linked neither one implied by the other. Task-4701303 Forward-Port-Of: odoo/enterprise#84515 Forward-Port-Of: odoo/enterprise#82954
In this commit, we prefer to use click on element instead of press Tab because tab will directly focus the other range period input. Forward-Port-Of: odoo/enterprise#83395 Forward-Port-Of: odoo/enterprise#82937
Original PR description
In this commit, we prefer to use click on element instead of press Tab because tab will directly focus the other range period input. Forward-Port-Of: odoo/enterprise#83395 Forward-Port-Of: odoo/enterprise#82937
**Traceback:** ```python ('helpdesk.helpdesk_ticket_menu_all', 117, 'Helpdesk > Tickets > All Tickets', 157): Traceback (most recent call last): File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 259, in crawl_menu self.mock_action(action_vals) File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 272, in mock_action return self.mock_act_window(action) File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 432, in moc
Original PR description
**Traceback:** ```python ('helpdesk.helpdesk_ticket_menu_all', 117, 'Helpdesk > Tickets > All Tickets', 157): Traceback (most recent call last): File…
**Traceback:**
```python
('helpdesk.helpdesk_ticket_menu_all', 117, 'Helpdesk > Tickets > All Tickets', 157):
Traceback (most recent call last):
File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 259, in crawl_menu
self.mock_action(action_vals)
File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 272, in mock_action
return self.mock_act_window(action)
File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 432, in mock_act_window
mock_method(model, view, fields_list, domain, group_by)
File "/tmp/tmpbeh7fp2m/migrations/base/tests/test_mock_crawl.py", line 463, in mock_view_form
[data] = record.read(fields_list)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 3814, in read
return self._read_format(fnames=fields, load=load)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4045, in _read_format
vals[name] = convert(record[name], record, use_display_name)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 7031, in __getitem__
return self._fields[key].__get__(self)
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 1303, in __get__
self.compute_value(recs)
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 1485, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/18.0/addons/base_automation/models/base_automation.py", line 816, in _compute_field_value
return _compute_field_value.origin(self, field)
File "/home/odoo/src/odoo/18.0/addons/mail/models/mail_thread.py", line 429, in _compute_field_value
return super()._compute_field_value(field)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 5253, in _compute_field_value
fields.determine(field.compute, self)
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 110, in determine
return needle(*args)
File "/home/odoo/src/enterprise/18.0/helpdesk/models/helpdesk_ticket.py", line 298, in _compute_partner_ticket_count
partner_tickets.fetch(['stage_id']) # prevent over-fetching fields, leading to potential out-of-memory error
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4095, in fetch
self.check_access('read')
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4394, in check_access
if not self.env.su and (result := self._check_access(operation)):
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4435, in _check_access
if domain and (forbidden := self - self.sudo().filtered_domain(domain)):
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 6627, in filtered_domain
data = record.mapped(key)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 6470, in mapped
recs = recs._fields[name].mapped(recs)
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 1377, in mapped
self.__get__(first(remaining))
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 3059, in __get__
return super().__get__(records, owner)
File "/home/odoo/src/odoo/18.0/odoo/fields.py", line 1266, in __get__
recs._fetch_field(self)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4071, in _fetch_field
self.fetch(fnames)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4108, in fetch
fetched = self._fetch_query(query, fields_to_fetch)
File "/home/odoo/src/odoo/18.0/odoo/models.py", line 4197, in _fetch_query
rows = self.env.execute_query(query.select(*sql_terms))
File "/home/odoo/src/odoo/18.0/odoo/api.py", line 979, in execute_query
return [] if self.cr.description is None else self.cr.fetchall()
MemoryError
```
Issue:
------
The `_compute_partner_ticket_count` method caused a MemoryError while running the test cases due to the large number of records and over fetching of `stage_id` in the line: `partner_tickets.fetch(['stage_id'])`
followed by: `partner_tickets.filtered(lambda ticket: not ticket.stage_id.fold)`
Solution:
---------
Replaced the fetch and filtered logic with a search method to resolve the MemoryError and improve performance
upg-2707381
opw-4653413
Forward-Port-Of: odoo/enterprise#83280- Since this PR: https://github.com/odoo/enterprise/pull/82531, the "Customer Statement" smart button (inside the customer form) was no longer visible when orders were paid via customer accounts in PoS and the session was closed. This was caused by session-level account.move records lacking partner_id, which caused _compute_has_moves to return false. - This fix overrides `_compute_has_moves` inside the module `pos_settle_due` to set `has_moves` to True when a partner's total_due is non-zero, en
Original PR description
- Since this PR: https://github.com/odoo/enterprise/pull/82531, the "Customer Statement" smart button (inside the customer form) was no longer visible when orders were paid via customer accounts in PoS and the session was closed. This was caused by session-level account.move records lacking partner_id, which caused _compute_has_moves to return false. - This fix overrides `_compute_has_moves` inside the module `pos_settle_due` to set `has_moves` to True when a partner's total_due is non-zero, ensuring the statement button remains visible when relevant. task-id: 4749148 Forward-Port-Of: odoo/enterprise#84206 Forward-Port-Of: odoo/enterprise#84003
### Issue: - In attendance-based contracts, lunch break intervals were automatically deducted from attendances,. - However, this deduction was not reflected in the generated work entries, resulting in inconsistencies between attendance duration and payroll calculations. ### Steps To Repoduce: - Set up an attendance-based contract with lunch break in the schedule. - Log attendance from 08:00 to 20:00 without logging out for lunch. - Observe: - The attendance has the lunch b
Original PR description
### Issue:
- In attendance-based contracts, lunch break intervals were automatically deducted from attendances,.
- However, this deduction was not reflected in the generated work entries, resulting in inconsistencies
between attendance duration and payroll calculations.
### Steps To Repoduce:
- Set up an attendance-based contract with lunch break in the schedule.
- Log attendance from 08:00 to 20:00 without logging out for lunch.
- Observe:
- The attendance has the lunch break interval deducted.
- The work entry does not, and includes the full duration.
### Solution:
- revert the change introduced in https://github.com/odoo/enterprise/pull/71979/commits/0a54ef993da3ef4882acdee1b8f5e378e2e9f2e0 only for contracts without flexible hours.
- Lunch breaks are now deducted from both attendances and work entries only when the contract has flexible_hours = False.
opw-4627247
Forward-Port-Of: odoo/enterprise#83825