Friday, January 24, 2025
2 changes · 18.0
Enhancements to existing features
This change reuses an already calculated maintenance deadline instead of calculating it a second time. It keeps the same behavior for users while making the maintenance scheduling code slightly simpler and more efficient.
Original PR description
Description of the issue/feature this PR addresses: In the bellow bloc code `fields.Datetime.from_string(request.schedule_date).date()` is computed twice, but was saved into a variable just above.…
Description of the issue/feature this PR addresses:
In the bellow bloc code `fields.Datetime.from_string(request.schedule_date).date()` is computed twice, but was saved into a variable just above.
```py
date_dl = fields.Datetime.from_string(request.schedule_date).date()
updated = request.activity_reschedule(
['maintenance.mail_act_maintenance_request'],
date_deadline=date_dl,
new_user_id=request.user_id.id or request.owner_user_id.id or self.env.uid)
if not updated:
note = request._get_activity_note()
request.activity_schedule(
'maintenance.mail_act_maintenance_request',
fields.Datetime.from_string(request.schedule_date).date(),
note=note, user_id=request.user_id.id or request.owner_user_id.id or self.env.uid)
```
Current behavior before PR:
The variable is computed twice
Desired behavior after PR is merged:
Using the cached variable instead
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prThe stock return wizard now places the "Return All" button near the end of the button list instead of between related return options. This makes the dialog easier to understand and reduces confusion when processing returns or exchanges.
Original PR description
We move the "Return All" button of the return wizard as the penultimate button since it is a bit Awkward to see it between "Return" and "Return for Exchange".