[ADD]:Added Upstream patch for payment_sips

This commit is contained in:
sheetalPatil 2018-07-09 19:12:44 +05:30
parent e978d8c5a5
commit 623614afff
3 changed files with 12 additions and 0 deletions

View File

@ -1,2 +1,3 @@
from . import models
from . import controllers
from flectra.addons.payment.models.payment_acquirer import create_missing_journal_for_acquirers

View File

@ -20,4 +20,5 @@ payments acquirer using Worldline SIPS.""",
'data/payment_acquirer_data.xml',
],
'installable': True,
'post_init_hook': 'create_missing_journal_for_acquirers',
}

View File

@ -111,6 +111,16 @@ class AcquirerSips(models.Model):
return self.environment == 'prod' and self.sips_prod_url or self.sips_test_url
class PaymentTransactionSips(models.Model):
_inherit = 'payment.transaction'
@api.model
def _get_next_reference(self, reference, acquirer=None):
if acquirer and acquirer.provider == 'sips':
reference = re.sub(r'[^0-9a-zA-Z]+', 'x' , reference)
return super(PaymentTransactionSips, self)._get_next_reference(reference, acquirer=acquirer)
class TxSips(models.Model):
_inherit = 'payment.transaction'