forked from OCA/credit-control
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] sale_financial_risk: Bypass risk when payment transaction is au…
…thorized
- Loading branch information
1 parent
f24d746
commit ba57959
Showing
2 changed files
with
22 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import sale | ||
from . import payment | ||
from . import res_partner | ||
from . import sale |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2020 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class PaymentTransaction(models.Model): | ||
_inherit = 'payment.transaction' | ||
|
||
def _set_transaction_authorized(self): | ||
"""Bypass risk for sale confirmation triggered by this method""" | ||
return super(PaymentTransaction, self.with_context( | ||
bypass_risk=True))._set_transaction_authorized() | ||
|
||
def _reconcile_after_transaction_done(self): | ||
"""Bypass risk for sale confirmation and invoice creation triggered | ||
by this method | ||
""" | ||
return super(PaymentTransaction, self.with_context( | ||
bypass_risk=True))._reconcile_after_transaction_done() |