From e177ce3d21f852ff0983901399c6d018efd9df46 Mon Sep 17 00:00:00 2001 From: "Daniel Kosky (dako)" Date: Tue, 31 Jan 2023 10:11:42 +0000 Subject: [PATCH] [FIX] l10n_ke_edi_tremol: fix unused hsn_name field Currently the hsn_name should be submitted every time the hsn_code is (i.e. when the line is not 16% standard rate taxed). However when serialising the data, a mistake means that this field is always empty in the message that gets sent to the device. This is because of the re.sub('[^0-9.]+', '', ...) regular expression, which replaces all the characters of the description (excepting digits and periods). This commit adjusts the way that this field is serialised to utilise the same formatter (_l10n_ke_fmt) as the other text fields used to construct the message. closes odoo/odoo#111529 X-original-commit: c087979c853bfcba28094d784d665033c42a1ccc Signed-off-by: Josse Colpaert Signed-off-by: Daniel Kosky (dako) --- addons/l10n_ke_edi_tremol/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_ke_edi_tremol/models/account_move.py b/addons/l10n_ke_edi_tremol/models/account_move.py index 3bb7f56974b..66d7e341860 100644 --- a/addons/l10n_ke_edi_tremol/models/account_move.py +++ b/addons/l10n_ke_edi_tremol/models/account_move.py @@ -183,7 +183,7 @@ class AccountMove(models.Model): uom = line.product_uom_id and line.product_uom_id.name or '' hscode = re.sub('[^0-9.]+', '', line.product_id.l10n_ke_hsn_code)[:10].ljust(10).encode('cp1251') if letter not in ('A', 'B') else b''.ljust(10) - hsname = re.sub('[^0-9.]+', '', line.product_id.l10n_ke_hsn_name)[:20].ljust(20).encode('cp1251') if letter not in ('A', 'B') else b''.ljust(20) + hsname = self._l10n_ke_fmt(line.product_id.l10n_ke_hsn_name, 20) if letter not in ('A', 'B') else b''.ljust(20) line_data = b';'.join([ self._l10n_ke_fmt(line.name, 36), # 36 symbols for the article's name self._l10n_ke_fmt(letter, 1), # 1 symbol for article's vat class ('A', 'B', 'C', 'D', or 'E')