Skip to content
Permalink
Browse files

[IMP]sale : improvement in payment reference

  • Loading branch information...
sza-odoo committed Mar 14, 2019
1 parent bef385d commit f940b09217c7376d33dbda15a2141bd004333b56
Showing with 2 additions and 2 deletions.
  1. +2 −2 addons/sale/models/payment.py
@@ -27,13 +27,13 @@ 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))
identification_number = None
prefix = 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 prefix if identification_number is None else '%s/%s' % (prefix, str(identification_number % 97).rjust(2, '0'))

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

0 comments on commit f940b09

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