Skip to content

Commit 8aca236

Browse files
committed
[IMP] account: Group Payment: Change memo to PAY/XXXX
When you create a payment in group in V18+, we generate a new payment memo using a BATCH/XXX prefix. It can be confusing as we have a Batch Payment feature, but it has nothing to do with it. We introduced in V18 a new PAY/XXX syntax for the payments without entries, so we might as well use the same syntax.
1 parent 6819f50 commit 8aca236

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

addons/account/models/company.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ResCompany(models.Model):
164164
'padding': 5,
165165
'use_date_range': True,
166166
'company_id': self.id,
167-
'prefix': 'BATCH/%(year)s/',
167+
'prefix': 'PAY/%(year)s/',
168168
}),
169169
)
170170

@@ -273,7 +273,7 @@ class ResCompany(models.Model):
273273
def get_next_batch_payment_communication(self):
274274
'''
275275
When in need of a batch payment communication reference (several invoices paid at the same time)
276-
use batch_payment_sequence_id to get it (eventually create it first): e.g BATCH/2024/00001
276+
use batch_payment_sequence_id to get it (eventually create it first): e.g PAY/2024/00001
277277
'''
278278
self.ensure_one()
279279
return self.sudo().batch_payment_sequence_id.next_by_id()

addons/account/tests/test_account_payment_register.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def test_register_payment_single_batch_grouped_keep_open_lower_amount(self):
202202
})._create_payments()
203203

204204
self.assertRecordValues(payments, [{
205-
'memo': Like(f'BATCH/{self.current_year}/...'),
205+
'memo': Like(f'PAY/{self.current_year}/...'),
206206
'payment_method_line_id': self.inbound_payment_method_line.id,
207207
}])
208208
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -235,7 +235,7 @@ def test_register_payment_single_batch_grouped_keep_open_higher_amount(self):
235235
})._create_payments()
236236

237237
self.assertRecordValues(payments, [{
238-
'memo': Like(f'BATCH/{self.current_year}/...'),
238+
'memo': Like(f'PAY/{self.current_year}/...'),
239239
'payment_method_line_id': self.inbound_payment_method_line.id,
240240
}])
241241
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -270,7 +270,7 @@ def test_register_payment_single_batch_grouped_writeoff_lower_amount_debit(self)
270270
})._create_payments()
271271

272272
self.assertRecordValues(payments, [{
273-
'memo': Like(f'BATCH/{self.current_year}/...'),
273+
'memo': Like(f'PAY/{self.current_year}/...'),
274274
'payment_method_line_id': self.inbound_payment_method_line.id,
275275
}])
276276
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -313,7 +313,7 @@ def test_register_payment_single_batch_grouped_writeoff_higher_amount_debit(self
313313
})._create_payments()
314314

315315
self.assertRecordValues(payments, [{
316-
'memo': Like(f'BATCH/{self.current_year}/...'),
316+
'memo': Like(f'PAY/{self.current_year}/...'),
317317
'payment_method_line_id': self.inbound_payment_method_line.id,
318318
}])
319319
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -356,7 +356,7 @@ def test_register_payment_single_batch_grouped_writeoff_lower_amount_credit(self
356356
})._create_payments()
357357

358358
self.assertRecordValues(payments, [{
359-
'memo': Like(f'BATCH/{self.current_year}/...'),
359+
'memo': Like(f'PAY/{self.current_year}/...'),
360360
'payment_method_line_id': self.outbound_payment_method_line.id,
361361
}])
362362
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -399,7 +399,7 @@ def test_register_payment_single_batch_grouped_writeoff_higher_amount_credit(sel
399399
})._create_payments()
400400

401401
self.assertRecordValues(payments, [{
402-
'memo': Like(f'BATCH/{self.current_year}/...'),
402+
'memo': Like(f'PAY/{self.current_year}/...'),
403403
'payment_method_line_id': self.outbound_payment_method_line.id,
404404
}])
405405
self.assertRecordValues(payments.move_id.line_ids.sorted('balance'), [
@@ -555,7 +555,7 @@ def test_register_payment_single_batch_grouped_with_credit_note(self):
555555

556556
self.assertRecordValues(payments, [
557557
{
558-
'memo': Like(f'BATCH/{self.current_year}/...'),
558+
'memo': Like(f'PAY/{self.current_year}/...'),
559559
'payment_method_line_id': self.outbound_payment_method_line.id,
560560
},
561561
])
@@ -676,7 +676,7 @@ def test_register_payment_multi_batches_grouped(self):
676676

677677
self.assertRecordValues(payments, [
678678
{
679-
'memo': Like(f'BATCH/{self.current_year}/...'),
679+
'memo': Like(f'PAY/{self.current_year}/...'),
680680
'payment_method_line_id': self.outbound_payment_method_line.id,
681681
},
682682
{
@@ -1747,7 +1747,7 @@ def test_installment_mode_multiple_batches(self):
17471747
'installments_mode': 'next',
17481748
'installments_switch_amount': 1333.33,
17491749
'currency_id': self.company.currency_id.id, # Different currencies, so we get the company's one
1750-
'communication': Like(f'BATCH/{self.current_year}/...'),
1750+
'communication': Like(f'PAY/{self.current_year}/...'),
17511751
}])
17521752

17531753
wizard = self.env['account.payment.register'].with_context(
@@ -1784,7 +1784,7 @@ def test_installment_mode_multiple_batches(self):
17841784
'payment_difference': 0.5,
17851785
'installments_mode': 'next',
17861786
'installments_switch_amount': 357.83, # 24.5 for in_invoice_epd_applied + 1000 / 3 (rate) for the second
1787-
'communication': Like(f'BATCH/{self.current_year}/...'),
1787+
'communication': Like(f'PAY/{self.current_year}/...'),
17881788
}])
17891789

17901790
# Clicking on the button to full gets the amount from js, so we need to put it by hand here
@@ -1798,7 +1798,7 @@ def test_installment_mode_multiple_batches(self):
17981798
'payment_difference': 0.5,
17991799
'installments_mode': 'full',
18001800
'installments_switch_amount': 57.83, # The previous 'next' amount
1801-
'communication': Like(f'BATCH/{self.current_year}/...'),
1801+
'communication': Like(f'PAY/{self.current_year}/...'),
18021802
}])
18031803

18041804
def test_payment_register_with_next_payment_date(self):

0 commit comments

Comments
 (0)