Skip to content
Permalink
Browse files

[IMP]sale : improve payment reference

Purpose of this task is,
Default payment ref for wire transfer is confusing and not really helpful as it will induce encoding errors customer side

So, I removed modulo part in payment reference

Task Id : 1946656
Closes : #31853
  • Loading branch information...
sza-odoo committed Mar 14, 2019
1 parent 3cbb8d5 commit 73c38a6185442e690120b152bfecbcecbe9b32b0
Showing with 2 additions and 4 deletions.
  1. +2 −4 addons/sale/models/payment.py
@@ -27,13 +27,11 @@ class PaymentTransaction(models.Model):
def _compute_sale_order_reference(self, order):
self.ensure_one()
if self.acquirer_id.so_reference_type == 'so_name':
identification_number = int(re.match('.*?([0-9]+)$', order.name).group(1))
prefix = order.name
return order.name
else:
# self.acquirer_id.so_reference_type == 'partner'
identification_number = order.partner_id.id
prefix = 'CUST'
return '%s/%s' % (prefix, str(identification_number % 97).rjust(2, '0'))
return '%s/%s' % ('CUST', str(identification_number % 97).rjust(2, '0'))

@api.depends('sale_order_ids')
def _compute_sale_order_ids_nbr(self):

0 comments on commit 73c38a6

Please sign in to comment.
You can’t perform that action at this time.