[FIX] l10n_vn: auto fill communication in bank application when scanning QR Code in invoice

Use the number "8" to define the header of communication in additional data.

Follow the EMVCo Merchant Presented QR Specification document: "If present,
the content of the data object value for IDs "01" to "08" shall be either ***
or a value defined by the merchant. The presence of *** indicates that the
mobile application is responsible for obtaining the necessary information.

Reviewed the Napas QR Specification of VietQR document. The number "8" means
Purpose of Transaction. And almost Bank Applications in Vietnam will use
the number "8" to auto-fill the communication on invoices to their applications.
Already checked with 4 bank applications, also 1 social application in Vietnam.

Closes #132479

closes odoo/odoo#133143

X-original-commit: 20d23b1206d0c47cbfd627f85b8c0144df552f10
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
This commit is contained in:
Minh Hong
2023-08-25 11:00:10 +02:00
parent 736acbf995
commit 5873464b32
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ class ResPartnerBank(models.Model):
def _get_additional_data_field(self, comment):
if self.country_code == 'VN':
return self._serialize(1, comment)
return self._serialize(8, comment)
return super()._get_additional_data_field(comment)
def _get_error_messages_for_qr(self, qr_method, debtor_partner, currency):
+2 -2
View File
@@ -81,7 +81,7 @@ class TestL10nVNEmvQrCode(AccountTestInvoicingCommon):
)
# Check the whole qr code string
self.assertEqual(emv_qr_vals, '00020101021238590010A0000007270129000697042201156607040600001290208QRIBFTTA52040000530370454031005802VN5914company_1_data6007Vietnam62170113INV/TEST/00016304E801')
self.assertEqual(emv_qr_vals, '00020101021238590010A0000007270129000697042201156607040600001290208QRIBFTTA52040000530370454031005802VN5914company_1_data6007Vietnam62170813INV/TEST/00016304600B')
def test_remove_vietnamese_accents(self):
accent_string = "áàảãạăắằẳẵặâấầẩẫậÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬéèẻẽẹêếềểễệÉÈẺẼẸÊẾỀỂỄỆóòỏõọôốồổỗộơớờởỡợÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢíìỉĩịÍÌỈĨỊúùủũụưứừửữựÚÙỦŨỤƯỨỪỬỮỰýỳỷỹỵÝỲỶỸỴđĐ"
@@ -102,4 +102,4 @@ class TestL10nVNEmvQrCode(AccountTestInvoicingCommon):
)
# Check the whole qr code string
self.assertEqual(emv_qr_vals, '00020101021238590010A0000007270129000697042201156607040600001290208QRIBFTTA52040000530370454031005802VN5914aAeEoOiIuUyYdD6007Vietnam62170113INV/TEST/0002630492AF')
self.assertEqual(emv_qr_vals, '00020101021238590010A0000007270129000697042201156607040600001290208QRIBFTTA52040000530370454031005802VN5914aAeEoOiIuUyYdD6007Vietnam62170813INV/TEST/000263041AA5')