Skip to content

Commit

Permalink
[IMP] sale_financial_risk: Bypass risk when payment transaction is au…
Browse files Browse the repository at this point in the history
…thorized
  • Loading branch information
carlosdauden committed Apr 29, 2020
1 parent f24d746 commit ba57959
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sale_financial_risk/models/__init__.py
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
20 changes: 20 additions & 0 deletions sale_financial_risk/models/payment.py
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()

0 comments on commit ba57959

Please sign in to comment.