Skip to content
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

sale_stock_restrict breaks ecommerce checkout in Odoo 16 #318

Open
knipknap opened this issue Jun 4, 2024 · 1 comment
Open

sale_stock_restrict breaks ecommerce checkout in Odoo 16 #318

knipknap opened this issue Jun 4, 2024 · 1 comment

Comments

@knipknap
Copy link

knipknap commented Jun 4, 2024

I get a traceback in Odoo 16 from the sale_stock_restrict when a customer completes an order:

odoo_odoo.1.0g3wnsle2emg@swarm    | 2024-06-04 20:44:42,001 13 ERROR odoo odoo.addons.payment.controllers.post_processing: encountered an error while post-processing transactions with ids 6:
odoo_odoo.1.0g3wnsle2emg@swarm    | Can't confirm the sale order due to: 
odoo_odoo.1.0g3wnsle2emg@swarm    |  You have added 1.0 units of Barebaric Raspberry Pi 5 Gehäuse aus Holz (Eiche oder Nussbaum), Case aus Echtholz but you only have 0.0 units available.
odoo_odoo.1.0g3wnsle2emg@swarm    |  
odoo_odoo.1.0g3wnsle2emg@swarm    | Traceback (most recent call last):
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/payment/controllers/post_processing.py", line 81, in poll_status
odoo_odoo.1.0g3wnsle2emg@swarm    |     txs_to_post_process._finalize_post_processing()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/website_payment/models/payment_transaction.py", line 13, in _finalize_post_processing
odoo_odoo.1.0g3wnsle2emg@swarm    |     super()._finalize_post_processing()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/account_payment/models/payment_transaction.py", line 201, in _finalize_post_processing
odoo_odoo.1.0g3wnsle2emg@swarm    |     super()._finalize_post_processing()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/payment/models/payment_transaction.py", line 889, in _finalize_post_processing
odoo_odoo.1.0g3wnsle2emg@swarm    |     self.filtered(lambda tx: tx.operation != 'validation')._reconcile_after_done()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/sale/models/payment_transaction.py", line 122, in _reconcile_after_done
odoo_odoo.1.0g3wnsle2emg@swarm    |     confirmed_orders = self._check_amount_and_confirm_order()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/usr/lib/python3/dist-packages/odoo/addons/sale/models/payment_transaction.py", line 84, in _check_amount_and_confirm_order
odoo_odoo.1.0g3wnsle2emg@swarm    |     quotation.with_context(send_email=True).action_confirm()
odoo_odoo.1.0g3wnsle2emg@swarm    |   File "/mnt/extra-addons/sale_stock_restrict/models/sale_order.py", line 94, in action_confirm
odoo_odoo.1.0g3wnsle2emg@swarm    |     raise UserError(listToStr)
odoo_odoo.1.0g3wnsle2emg@swarm    | odoo.exceptions.UserError: Can't confirm the sale order due to: 
odoo_odoo.1.0g3wnsle2emg@swarm    |  You have added 1.0 units of Barebaric Raspberry Pi 5 Gehäuse aus Holz (Eiche oder Nussbaum), Case aus Echtholz but you only have 0.0 units available.

This doesn't really make sense to me, as this

a) happens after the order is already made an the payment was confirmed.
b) The product and all variants are actually still in stock in the inventory, so the claim "you have 0.0 units available" is just wrong.

And this is what the customer sent me:

Screenshot from 2024-06-05 00-03-43

@CybroOdoo
Copy link
Owner

HI @knipknap ,
We will check the issue and get back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants