-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[17.0][MIG] website_sale_checkout_skip_payment: Continue migration to…
… version 17.0 TT51969
- Loading branch information
1 parent
768e629
commit 3f63db0
Showing
4 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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** | ||
|
||
|
@@ -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 | ||
----------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -25,13 +25,13 @@ def shop_payment_confirmation(self, **post): | |
return super().shop_payment_confirmation(**post) | ||
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( | ||
"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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]>\> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters