Skip to content

[FIX] point_of_sale: Avoid transaction aborted errors when handling failed orders #27932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: 16.0
Choose a base branch
from

Conversation

BT-sschmid
Copy link

@BT-sschmid BT-sschmid commented Jun 12, 2024

POSSession._handle_order_process_fail is usally called on any Exceptions, also on DB-related exception which may abort the current transaction.
In this case, the call to _is_capture_system_activated raises with an TransactionAborted Error, which shadows the real traceback of the original
Exception.

This PR moves the Rollback to the top of the Method.
This is safe as the caller raises anyway.

DavidFesquet and others added 5 commits June 12, 2024 06:15
In the context of an export with a lot of records containing a 'stock.move' field (ex: stock.valuation.layer.stock_move_id):
 - Only the picking_id.origin, product_id.code and location(_dest)_id.name are needed.
 - Most of the data of picking_id, product_id and location(_dest)_id will be fetch and put in cache.
This can result in a memory error as multiple thousands of records values (at the very least) will be stored in the cache.

Customer cases:
STOCK.MOVE: 350_000
BEFORE:     980 MB
AFTER:      105 MB

OPW-3911127

closes odoo#167587

X-original-commit: b755048
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
  Check that order is not finalized when trying
  to updateRewards on a paid order.

Part-of: odoo#168142
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
closes odoo#168142

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
In the journal entry you can group by partner/date/journal/company, but in vendor bill or customer invoice you cannot.

closes odoo#168339

X-original-commit: 0377960
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Steps to reproduce:
- Install "Time Off" and `l10n_be`
- "Time Off" -> "Reporting" -> "by Type"
- Unselect the company with the time off

Issues:
All the time off will be shown, company selection will not be taken into
account. This is due to a missing security rules.

opw-3954393

closes odoo#168860

X-original-commit: b756dbd
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
@bt-admin bt-admin added the 16.0 label Jun 12, 2024
@BT-sschmid BT-sschmid force-pushed the 16.0.bt27553.pos_fix_transaction_abort branch 2 times, most recently from 413de0d to c0f15e5 Compare June 12, 2024 14:41
@BT-sschmid BT-sschmid changed the title [CLA] Add new CLA [FIX] point_of_sale: Avoid transaction aborted errors when handling failed orders Jun 12, 2024
…ailed orders

POSSession._handle_order_process_fail is usally called on any Exceptions, also on DB-related exception which may abort the current transaction.
In this case, the call to _is_capture_system_activated raises with an TransactionAborted Error, which shadows the real traceback of the original
Exception.

This PR moves the Rollback to the top of the Method.
This is safe as the caller raises anyway.
@BT-sschmid BT-sschmid force-pushed the 16.0.bt27553.pos_fix_transaction_abort branch from c0f15e5 to 391e695 Compare June 12, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants