Daily updates from Odoo
Tuesday, August 31, 2021
7 changes · master
Enhancements to existing features
Portal users can no longer change the worksheet template on shared field service task forms. This keeps the assigned template visible while preventing unintended edits in project sharing views.
Original PR description
Before this commit, the portal user could select the worksheet_template field in the task form view when he is in project sharing views. This commit removes this possibility. Now the portal user will only can see the worksheet_template selected for this task. Part of task-2633229
Approvers now receive a clearer warning when they try to validate timesheets for employees outside their team. This helps managers understand that the issue is access-related rather than suggesting there are no timesheets to review.
Original PR description
Before this commit: If approver try to validate the timesheet of another team's member than warning message is displayed 'There are no timesheets to validate.' After this commit: Modifoed the behaviour of approver by enhancing the message 'There are no timesheets to validate.' when approver try to validate the timesheet of another with 'You cannot validate the timesheets from employees that are not part of your team.' and altered relevant test case. Task - 2531321
Resolved issues and error corrections
The Planning schedule view has been adjusted so action buttons such as copying the previous week and sending the schedule line up properly. This improves the visual consistency of the planning screen and makes the controls easier to use.
Original PR description
Purpose of the commit is to fix the button's alignment in planning. Adjust the alignment of copy previous week button and send schedule button in planning Gantt view. **TaskID: 2623507**
A redundant dependency field was removed from the Project Enterprise module. This reduces duplicate internal data definitions and helps keep project functionality more reliable and maintainable.
Original PR description
Fixes field redundancy introduced in 6726fc16dbda0c81c48540eeda41cdae0394f28d.
Moving an unassigned planning shift to another day no longer automatically assigns it to an employee. This keeps open shifts available as intended and prevents accidental staffing changes during scheduling.
Original PR description
[FIX] planning: moving an open shift from one day to another assigns it to an employee
Steps to reproduce the issue:
- Go into planning
- Create a shift without assigning an employee
- The slot appears in the open shift row
- Reschedule the slot to another day by drag and dropping it
- The slot is assigned to an employee
Expected behavior after the fix:
- A slot located in the open shift row should be rescheduled without being assigned to an employee
task-2634032Miscellaneous changes
Reading an image directly from the filestore is prone to errors when the image file is deleted. Moreover it causes issues during upgrades when the filestore is not available. Example traceback when the file is missing from the filestore ``` Traceback (most recent call last): File "/tmp/tmpmh88kwtq/migrations/base/tests/test_mock_crawl.py", line 181, in crawl_menu self.mock_action(action_vals) File "/tmp/tmpmh88kwtq/migrations/base/tests/test_mock_crawl.py", line 292, in moc
Original PR description
Reading an image directly from the filestore is prone to errors when the image file is deleted. Moreover it causes issues during upgrades when the filestore is not available. Example traceback when…
Reading an image directly from the filestore is prone to errors when the
image file is deleted.
Moreover it causes issues during upgrades when the filestore is not
available.
Example traceback when the file is missing from the filestore
```
Traceback (most recent call last):
File "/tmp/tmpmh88kwtq/migrations/base/tests/test_mock_crawl.py", line 181, in crawl_menu
self.mock_action(action_vals)
File "/tmp/tmpmh88kwtq/migrations/base/tests/test_mock_crawl.py", line 292, in mock_action
mock_method(model, view, fields_list, domain, group_by)
File "/tmp/tmpmh88kwtq/migrations/base/tests/test_mock_crawl.py", line 318, in mock_view_form
[data] = record.read(fields_list)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3016, in read
return self._read_format(fnames=fields, load=load)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3036, in _read_format
vals[name] = convert(record[name], record, use_name_get)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5662, in __getitem__
return self._fields[key].__get__(self, type(self))
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1019, in __get__
self.compute_value(recs)
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1175, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/14.0/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
return super()._compute_field_value(field)
File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4057, in _compute_field_value
getattr(self, field.compute)()
File "/home/odoo/src/enterprise/14.0/social_facebook/models/social_post.py", line 41, in _compute_facebook_preview
else base64.b64encode(open(image._full_path(image.store_fname), 'rb').read()) for image in post.image_ids
File "/home/odoo/src/enterprise/14.0/social_facebook/models/social_post.py", line 41, in <listcomp>
else base64.b64encode(open(image._full_path(image.store_fname), 'rb').read()) for image in post.image_ids
FileNotFoundError: [Errno 2] No such file or directory: '/home/odoo/.local/share/Odoo/filestore/db_23108/f5/f541d3636c124ccdc6fbcc42354bd280f04104f8'
```
Related: odoo/odoo#61037
Specifically: the issue with `bin_size` when reading images.
Observed during upgrade 23108.
Forward-Port-Of: odoo/enterprise#20503
Forward-Port-Of: odoo/enterprise#20489Steps to follow - Create an asset with original_value = 1000, duration = 4 years - Set already_depreciated_amount_import to 200 - Set depreciated_number_import to 1 - Edit the depreciation amount of a line, for example the first one to 210 -> The depreciable value is now 790 but it should be 590 Cause of the issue The depreciated amount isn't taken into account when modifying a depreciation manually opw-2539021 Forward-Port-Of: odoo/enterprise#20492
Original PR description
Steps to follow - Create an asset with original_value = 1000, duration = 4 years - Set already_depreciated_amount_import to 200 - Set depreciated_number_import to 1 - Edit the depreciation amount of a line, for example the first one to 210 -> The depreciable value is now 790 but it should be 590 Cause of the issue The depreciated amount isn't taken into account when modifying a depreciation manually opw-2539021 Forward-Port-Of: odoo/enterprise#20492