From 3744b5a60b32358a7c4d9189e18e89da582984ad Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Mon, 8 Jun 2015 14:15:46 +0200 Subject: [PATCH] [IMP]Move the field journal_id in the main module. By moving the field in the main module the others parsers can use it without duplicate it --- .../account_bank_statement_import.py | 14 ++++++ .../account_bank_statement_import_view.xml | 6 +++ .../i18n/account_bank_statement_import.pot | 45 ++++++++++++------- .../__openerp__.py | 3 -- .../account_bank_statement_import_qif.py | 10 +---- ...account_bank_statement_import_qif_view.xml | 24 ---------- .../account_bank_statement_import_qif.pot | 8 ++-- 7 files changed, 54 insertions(+), 56 deletions(-) delete mode 100644 account_bank_statement_import_qif/account_bank_statement_import_qif_view.xml diff --git a/account_bank_statement_import/account_bank_statement_import.py b/account_bank_statement_import/account_bank_statement_import.py index cd7a46cf..c37460f1 100644 --- a/account_bank_statement_import/account_bank_statement_import.py +++ b/account_bank_statement_import/account_bank_statement_import.py @@ -27,6 +27,20 @@ class AccountBankStatementImport(models.TransientModel): _name = 'account.bank.statement.import' _description = 'Import Bank Statement' + @api.model + def _get_hide_journal_field(self): + """ Return False if the journal_id can't be provided by the parsed + file and must be provided by the wizard. + See account_bank_statement_import_qif """ + return True + + journal_id = fields.Many2one( + 'account.journal', string='Journal', + help='Accounting journal related to the bank statement you\'re ' + 'importing. It has be be manually chosen for statement formats which ' + 'doesn\'t allow automatic journal detection (QIF for example).') + hide_journal_field = fields.Boolean( + 'Hide the journal field in the view', default=_get_hide_journal_field) data_file = fields.Binary( 'Bank Statement File', required=True, help='Get you bank statements in electronic format from your bank ' diff --git a/account_bank_statement_import/account_bank_statement_import_view.xml b/account_bank_statement_import/account_bank_statement_import_view.xml index 8fc98a45..6aaa888c 100644 --- a/account_bank_statement_import/account_bank_statement_import_view.xml +++ b/account_bank_statement_import/account_bank_statement_import_view.xml @@ -9,6 +9,12 @@
+ +