Skip to content

Commit

Permalink
[17.0][MIG] website_sale_checkout_skip_payment: Continue migration to…
Browse files Browse the repository at this point in the history
… version 17.0

TT51969
  • Loading branch information
pilarvargas-tecnativa committed Dec 18, 2024
1 parent 768e629 commit 3f63db0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions website_sale_checkout_skip_payment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Website Sale Checkout Skip Payment
|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to logged users to checkout with no payment step. At
the end of the checkout proccess the quotation is sent to the user email
address and set to *Qoutation Sent* state.
the end of the checkout process the quotation is sent to the user email
address and set to *Quotation Sent* state.

**Table of contents**

Expand Down Expand Up @@ -80,12 +80,15 @@ Contributors
- David Vidal
- Alexandre Díaz
- Carlos Roca
- Pilar Vargas

- Martin Wilderoth <[email protected]>
- `Studio73 <https://www.studio73.es>`__:

- Miguel Gandia <[email protected]>

- Alexei Rivera <[email protected]>

Maintainers
-----------

Expand Down
8 changes: 4 additions & 4 deletions website_sale_checkout_skip_payment/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2017 David Vidal <[email protected]>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import SUPERUSER_ID, http
from odoo import http
from odoo.http import request

from odoo.addons.website_sale.controllers.main import WebsiteSale
Expand All @@ -25,13 +25,13 @@ def shop_payment_confirmation(self, **post):
return super().shop_payment_confirmation(**post)

Check warning on line 25 in website_sale_checkout_skip_payment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_checkout_skip_payment/controllers/main.py#L25

Added line #L25 was not covered by tests
order = request.env["sale.order"].sudo().browse(order_id)
try:
order.with_context(send_email=True, mark_so_as_sent=True).with_user(
SUPERUSER_ID
).action_confirm()
order.with_context(mark_so_as_sent=True)._send_order_confirmation_mail()
except Exception:
return request.render(

Check warning on line 30 in website_sale_checkout_skip_payment/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_checkout_skip_payment/controllers/main.py#L29-L30

Added lines #L29 - L30 were not covered by tests
"website_sale_checkout_skip_payment.confirmation_order_error"
)
# This could not finish (e.g.: sale_financial_risk exceeded)
order.action_confirm()
request.website.sale_reset()
values = self._prepare_shop_payment_confirmation_values(order)
return request.render("website_sale.confirmation", values)
1 change: 1 addition & 0 deletions website_sale_checkout_skip_payment/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- David Vidal
- Alexandre Díaz
- Carlos Roca
- Pilar Vargas
- Martin Wilderoth \<<[email protected]>\>
- [Studio73](https://www.studio73.es):
- Miguel Gandia \<<[email protected]>\>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>David Vidal</li>
<li>Alexandre Díaz</li>
<li>Carlos Roca</li>
<li>Pilar Vargas</li>
</ul>
</li>
<li>Martin Wilderoth &lt;<a class="reference external" href="mailto:martin.wilderoth&#64;linserv.se">martin.wilderoth&#64;linserv.se</a>&gt;</li>
Expand Down

0 comments on commit 3f63db0

Please sign in to comment.