Wednesday, August 7, 2024
6 changes · saas-17.4
Resolved issues and error corrections
Fixes an error that occurred when staff entered a coupon or gift card code in Point of Sale before adding any items to the cart. This helps cashiers apply customer promotions smoothly without interrupting checkout.
Original PR description
Steps: - Create a program type = Coupon - Set rules & rewards, In rewards give free product - Generate a new coupon & copy it - Open POS and open Enter code - Paste the newly created coupon without adding any product in pos cart Issue: - Traceback error when manually applying a coupon in the POS with an empty cart. Cause: - Attempts to access coupon.balance to display a message, but the loyalty.card model does not have a field named balance. Fix: - Replace coupon.balance with coupon.points. task-4070130
A display issue in the mail input field on public pages has been corrected by removing a styling dependency that was not available there. This helps ensure the input appears consistently for visitors using public-facing pages.
Original PR description
The SCSS class `.o_input` is not available in public asset bundles and half of the attributes were bypassed anyway. This commit get rids of this unnecessary dependency. Before / After <img width="317" alt="Screenshot 2024-08-07 at 11 36 24" src="https://github.com/user-attachments/assets/2751a933-c757-4700-b9f3-8299ffe59002"> <img width="288" alt="Screenshot 2024-08-07 at 11 36 10" src="https://github.com/user-attachments/assets/58f20a9d-c530-46a2-b1d0-2ac529f84eb4"> TASK-4100234
Employees can now manually check in or out through Attendance Kiosk Mode even when their profile has no photo. This prevents an error that blocked attendance actions for employees missing an avatar.
Original PR description
Currently, an error occurs when employees manually do their attendance, and an employee's avatar is not available. Step to produce: - Install the 'hr_attendance' module. - Go to the Employees open…
Currently, an error occurs when employees manually do their attendance, and an employee's avatar is not available.
Step to produce:
- Install the 'hr_attendance' module.
- Go to the Employees open any employee and remove an image from it.
- Go to Attendances / Kiosk Mode and click 'Identify Manually', Open the employee who does not have an image.
Stack Trace:
```
TypeError: 'bool' object is not subscriptable
File "odoo/http.py", line 2373, in __call__
response = request._serve_db()
File "odoo/http.py", line 1903, in _serve_db
return self._transactioning(
File "odoo/http.py", line 1966, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1933, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2177, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 223, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 754, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/hr_attendance/controllers/main.py", line 137, in employee_attendance_data
return self._get_employee_info_response(employee)
File "addons/hr_attendance/controllers/main.py", line 39, in _get_employee_info_response
'employee_avatar': image_data_uri(employee.image_256),
File "odoo/tools/image.py", line 540, in image_data_uri
FILETYPE_BASE64_MAGICWORD.get(base64_source[:1], 'png'),
```
An error occurs when the system tries to retrieve a data URL from an employee image but it is not available resulting False (bool) value passing instead of binary.
link [1]:https://github.com/odoo/odoo/blob/0a69d91ff2ccb90fc5ca94013a4fc7371017c876/addons/hr_attendance/controllers/main.py#L39
To handle this issue, Add a condition that, Only converts data URI from an employee's image if it is available.
Sentry-5681797884
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prWhen a vendor bill is posted without a payment reference, Odoo now automatically uses the bill reference instead. This prevents empty payment labels and improves consistency in accounting entries generated from bills.
Original PR description
[FIX] account: Fix the payment reference if empty We have a placeholder on the payment reference "Use Bill Reference" which should use the bill ref if the payment reference if empty We added the placeholder and forgot to add the logic of it Solution: when posting, fill the payment ref with the bill ref if empty Benefit: This will help odoo when recomputing the label of the journal items when posting the bills as it's currently having it empty as we missed to have that functionality in-place when we added the placeholder task-id#4004739 enterprise-pr#[66300](https://github.com/odoo/enterprise/pull/66300) --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Users can now remove the journal while registering an invoice payment without causing an error screen. This keeps the payment workflow stable and avoids interruptions from an invalid or missing journal selection.
Original PR description
Currently, a traceback occurs when the user removes the `journal` while registering a payment. To reproduce this issue: 1) Install `accounting` 2) create an invoice with a line and confirm it 3) Click on `payment Register` and remove the `journal` Error:- ``` ValueError: Expected singleton: account.journal() ``` This is because when the user removes the journal a compute method triggers, through which another method `_fetch_duplicate_reference` calls. In this method, `journal_id` is referenced to call another method in which ensure one is used. This leads to the traceback https://github.com/odoo/odoo/blob/79aef2ed06f813197651f83272d4508200a8ce72/addons/account/wizard/account_payment_register.py#L675-L677 After applying this commit, it will resolve this issue by doing an extra check of j`ournal_id`, which makes the code more robust. sentry-5675331371
Vendor bills now automatically use the bill reference as the payment reference when no payment reference is entered. This prevents blank payment labels during posting and helps accounting entries stay clear and consistent.
Original PR description
[FIX] account: Fix the payment reference if empty We have a placeholder on the payment reference "Use Bill Reference" which should use the bill ref if the payment reference if empty We added the placeholder and forgot to add the logic of it Solution: when posting, fill the payment ref with the bill ref if empty Benefit: This will help odoo when recomputing the label of the journal items when posting the bills as it's currently having it empty as we missed to have that functionality in-place when we added the placeholder task-id#4004739 odoo-pr#[172387](https://github.com/odoo/odoo/pull/172387)