Commit Graph
5 Commits
Author SHA1 Message Date
aamo-odoo 622c018a65 [FIX] account: update object reference in loop
In line[1], self is referenced to _get_default_mail_attachments_widget, and
using self instead of wizard doesn't make sense because self could potentially
hold multiple values. This becomes problematic when the ensure_one method is
called. Due to this below error is raised.

Traceback : ValueError
Expected singleton: account.move.send(168, 167)

[1] : https://github.com/odoo/odoo/blob/167dedab5c7423097689c6a7d0d6ee6dd904a8bf/addons/account/wizard/account_move_send.py#L311-L312

sentry - 5234450902

closes odoo/odoo#162829

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-04-25 15:26:19 +00:00
aamo-odoo be8b9c9d80 [FIX] gamification: remove "completeness" field from order by in SQL
We are removing the "completeness" field from the order because it's a
non-storable field. When we attempt to access this field, it triggers a logger
warning check at line [1].

This commit will help you to implement a "goals" search by domain and order by
"ID" and sorting by "completeness" and "current" value, with condition-based
sorting for 'higher' or 'lower' requirements check at line[2].

[1] : https://github.com/odoo/odoo/pull/127353/commits/12e9749bcc1dc4f7b1a129933ae16840195bcae8#diff-7144f88ea32f36feb17ce1b8dda7dee1631f5ada34075414587df3948c6b3d1bL5317
[2] : https://github.com/odoo/odoo/blob/5c5b4d991423e0282d06a98e5677977d53dc0817/addons/gamification/models/gamification_challenge.py#L545-L548

sentry - 5162134321

closes odoo/odoo#161270

Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2024-04-25 11:21:44 +00:00
aamo-odoo 6a4808802c [FIX] resource: prevent ZeroDivision Error while adding first working hours
This error occurs when the user adds a new "Working Schedule" to the resource,
switches to the two-week calendar view, removes all the existing "Working Hours"
lines, and then attempts to add a new line under "Working Hours."

Steps to reproduce:
- Install "resource" module
- Settings -> Technical -> Resource -> Working Schedules
- New -> Switch to 2 week calendar -> Remove all "Working Hours" lines
- Click on Add a line

Traceback: ZeroDivisionError
float division by zero

This commit implements a check for the variable "number_of_days". If the value
of "number_of_days" is zero or not found, the function will return zero.
This ensures that the function behaves appropriately in cases where the number
of days is zero.

https://github.com/odoo/odoo/blob/5177e21aea68959eedc73e0034ed984992392dd7/addons/resource/models/resource_calendar.py#L185

sentry - 5108250957

closes odoo/odoo#159844

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-29 12:38:11 +00:00
aamo-odoo 49bec71d12 [FIX] stock_account: prevent error if warehouse location not found.
An error occurs when the user attempts to access a forecast report for the
replenishment product but does not receive the warehouse location ID
(archive/delete).

Steps to reproduce: (without demo data)
- Install "stock_account"  module
- Inventory -> Operation -> Procurement -> Replenishment
- Create a new Replenishment product
- Configuration -> warehouse -> Archive warehouse records
- Go to a product made in the replenishment and click on forecast report

Traceback : "IndexError
list index out of range"

This commit will help to open a forecast report if the warehouse location is not
found.

sentry-4998176742

closes odoo/odoo#158017

Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2024-03-19 09:24:21 +00:00
aamo-odoo 91e7c5313d [FIX] base : new attachement directory creation
Fix race-condition when a directory is created by two processes (python's os.py
handles it for all directories, but not for the last one). Happens sometimes
when generating assets for the first time (CSS, JS); one of the two times might
crash.

sentry-4417110945

closes odoo/odoo#156232

Signed-off-by: Fabien Pinckaers (fp) <fp@odoo.com>
2024-03-04 09:52:08 +00:00