Skip to content

Commit

Permalink
[MIG] account_statement_import_txt_xlsx: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomacr committed Oct 5, 2022
1 parent 0e236e9 commit 58dc39c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 51 deletions.
2 changes: 1 addition & 1 deletion account_statement_import_txt_xlsx/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Bank Statement TXT/CSV/XLSX Import",
"summary": "Import TXT/CSV or XLSX files as Bank Statements in Odoo",
"version": "14.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Accounting",
"website": "https://github.com/OCA/bank-statement-import",
"author": "ForgeFlow, CorporateHub, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class AccountStatementImportSheetMapping(models.Model):
default="utf-8",
)
delimiter = fields.Selection(
string="Delimiter",
selection=[
("dot", "dot (.)"),
("comma", "comma (,)"),
Expand All @@ -55,34 +54,29 @@ class AccountStatementImportSheetMapping(models.Model):
default="comma",
)
quotechar = fields.Char(string="Text qualifier", size=1, default='"')
timestamp_format = fields.Char(string="Timestamp Format", required=True)
timestamp_column = fields.Char(string="Timestamp column", required=True)
timestamp_format = fields.Char(required=True)
timestamp_column = fields.Char(required=True)
currency_column = fields.Char(
string="Currency column",
help=(
"In case statement is multi-currency, column to get currency of "
"transaction from"
),
)
amount_column = fields.Char(
string="Amount column",
required=True,
help="Amount of transaction in journal's currency",
)
balance_column = fields.Char(
string="Balance column",
help="Balance after transaction in journal's currency",
)
original_currency_column = fields.Char(
string="Original currency column",
help=(
"In case statement provides original currency for transactions "
"with automatic currency conversion, column to get original "
"currency of transaction from"
),
)
original_amount_column = fields.Char(
string="Original amount column",
help=(
"In case statement provides original currency for transactions "
"with automatic currency conversion, column to get original "
Expand All @@ -97,36 +91,24 @@ class AccountStatementImportSheetMapping(models.Model):
),
)
debit_value = fields.Char(
string="Debit value",
help="Value of debit/credit column that indicates if it's a debit",
default="D",
)
credit_value = fields.Char(
string="Credit value",
help="Value of debit/credit column that indicates if it's a credit",
default="C",
)
transaction_id_column = fields.Char(
string="Unique transaction ID column",
)
description_column = fields.Char(
string="Description column",
)
notes_column = fields.Char(
string="Notes column",
)
reference_column = fields.Char(
string="Reference column",
)
partner_name_column = fields.Char(
string="Partner Name column",
)
description_column = fields.Char()
notes_column = fields.Char()
reference_column = fields.Char()
partner_name_column = fields.Char()
bank_name_column = fields.Char(
string="Bank Name column",
help="Partner's bank",
)
bank_account_column = fields.Char(
string="Bank Account column",
help="Partner's bank account",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_header(self, data_file, encoding, csv_options):
values = sheet.row_values(0)
return [str(value) for value in values]
except xlrd.XLRDError:
pass
_logger.error("Pass this method")

data = StringIO(data_file.decode(encoding or "utf-8"))
csv_data = reader(data, **csv_options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,33 @@ class AccountStatementImportSheetMappingWizard(models.TransientModel):
selection=lambda self: self._selection_file_encoding(),
)
delimiter = fields.Selection(
string="Delimiter",
selection=lambda self: self._selection_delimiter(),
)
quotechar = fields.Char(
string="Text qualifier",
size=1,
)
timestamp_column = fields.Char(
string="Timestamp column",
)
timestamp_column = fields.Char()
currency_column = fields.Char(
string="Currency column",
help=(
"In case statement is multi-currency, column to get currency of "
"transaction from"
),
)
amount_column = fields.Char(
string="Amount column",
help="Amount of transaction in journal's currency",
)
balance_column = fields.Char(
string="Balance column",
help="Balance after transaction in journal's currency",
)
original_currency_column = fields.Char(
string="Original currency column",
help=(
"In case statement provides original currency for transactions "
"with automatic currency conversion, column to get original "
"currency of transaction from"
),
)
original_amount_column = fields.Char(
string="Original amount column",
help=(
"In case statement provides original currency for transactions "
"with automatic currency conversion, column to get original "
Expand All @@ -75,36 +67,24 @@ class AccountStatementImportSheetMappingWizard(models.TransientModel):
),
)
debit_value = fields.Char(
string="Debit value",
help="Value of debit/credit column that indicates if it's a debit",
default="D",
)
credit_value = fields.Char(
string="Credit value",
help="Value of debit/credit column that indicates if it's a credit",
default="C",
)
transaction_id_column = fields.Char(
string="Unique transaction ID column",
)
description_column = fields.Char(
string="Description column",
)
notes_column = fields.Char(
string="Notes column",
)
reference_column = fields.Char(
string="Reference column",
)
partner_name_column = fields.Char(
string="Partner Name column",
)
description_column = fields.Char()
notes_column = fields.Char()
reference_column = fields.Char()
partner_name_column = fields.Char()
bank_name_column = fields.Char(
string="Bank Name column",
help="Partner's bank",
)
bank_account_column = fields.Char(
string="Bank Account column",
help="Partner's bank account",
)

Expand Down

0 comments on commit 58dc39c

Please sign in to comment.