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 a1ca7bc22b1aad7c3136bbb01001be59d2766b52
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))
prefix = order.name
return prefix
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' % (prefix, str(identification_number % 97).rjust(2, '0'))

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

0 comments on commit a1ca7bc

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