Skip to content

Commit

Permalink
TA#66666 [CHG][FIX][i18N] bank_statement_import_csv : char handling w…
Browse files Browse the repository at this point in the history
…hen empty (#181)

* [FIX] bank_statement_import_csv : char handling when empty
  • Loading branch information
lanto-razafindrabe authored Jun 25, 2024
1 parent cae54e7 commit 751ae34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bank_statement_import_csv/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ msgstr "Le séparateur décimal ne doit pas être vide ni rempli d'espaces."
#. module: bank_statement_import_csv
#: model:ir.model.fields,field_description:bank_statement_import_csv.field_bank_statement_import_config__delimiter
msgid "Delimiter"
msgstr "Délimiteur"
msgstr "Délimiteur de colonne"

#. module: bank_statement_import_csv
#: model:ir.model.fields,field_description:bank_statement_import_csv.field_bank_statement_import_config__deposit_column
Expand Down Expand Up @@ -432,7 +432,7 @@ msgstr "Le caractère utilisé pour séparer la partie entière de la partie dé
#. module: bank_statement_import_csv
#: model:ir.model.fields,help:bank_statement_import_csv.field_bank_statement_import_config__thousands_separator
msgid ""
"The character used to separate the thousands in decimal value.By default is "
"The character used to separate the thousands in decimal value. By default is "
"space."
msgstr "Le caractère utilisé pour séparer les milliers dans la valeur décimale. Par défaut, c'est l'espace."

Expand Down
11 changes: 7 additions & 4 deletions bank_statement_import_csv/models/bank_statement_import_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BankStatementImportConfig(models.Model):
"starting with the latest transaction."
)
delimiter = fields.Char(default=",", required=True)
quotechar = fields.Char()
quotechar = fields.Char(default='"')
encoding = fields.Char(
required=True,
default="utf-8",
Expand Down Expand Up @@ -72,8 +72,11 @@ class BankStatementImportConfig(models.Model):
)
thousands_separator = fields.Char(
default=" ",
help=("The character used to separate the thousands in decimal value."
"By default is space."),
help=(
"The character used to separate the thousands in decimal value. "
"By default is space."
),
trim=False,
)

def get_csv_loader_config(self):
Expand All @@ -82,7 +85,7 @@ def get_csv_loader_config(self):
"delimiter": self.delimiter or None,
"quotechar": self.quotechar or None,
"decimal_separator": self.decimal_separator,
"thousands_separator": self.thousands_separator,
"thousands_separator": self.thousands_separator or "",
"date": {
"index": self.date_column - 1,
"format": self.date_format,
Expand Down

0 comments on commit 751ae34

Please sign in to comment.