From 1ab9e7d964865d22e924de8470989e09b2993dad Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 4 Nov 2019 22:54:56 +0100 Subject: [PATCH] [MIG] account_bank_statement_import_move_line: Fix tests + URL --- .../__manifest__.py | 2 +- ...ccount_bank_statement_import_move_line.pot | 54 +++++++++---------- ...account_bank_statement_import_move_line.py | 8 +-- .../wizards/account_statement_line_create.py | 1 + 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/account_bank_statement_import_move_line/__manifest__.py b/account_bank_statement_import_move_line/__manifest__.py index ac1e9b30..e7795292 100644 --- a/account_bank_statement_import_move_line/__manifest__.py +++ b/account_bank_statement_import_move_line/__manifest__.py @@ -9,7 +9,7 @@ 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', 'maintainers': ['pedrobaeza'], - 'website': 'https://www.tecnativa.com', + 'website': 'https://github.com/OCA/bank-statement-import', 'depends': [ 'account', ], diff --git a/account_bank_statement_import_move_line/i18n/account_bank_statement_import_move_line.pot b/account_bank_statement_import_move_line/i18n/account_bank_statement_import_move_line.pot index 1d04ab60..bdcd3f34 100644 --- a/account_bank_statement_import_move_line/i18n/account_bank_statement_import_move_line.pot +++ b/account_bank_statement_import_move_line/i18n/account_bank_statement_import_move_line.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Add All Move Lines" msgstr "" @@ -29,27 +29,27 @@ msgid "All Posted Entries" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_allow_blocked +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__allow_blocked msgid "Allow Litigation Move Lines" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_statement_id +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__statement_id msgid "Bank Statement" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Cancel" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Choose Move Lines Filter Options" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Click on Add All Move Lines to auto-select the move lines matching the above criteria or click on Add an item to manually select the move lines filtered by the above criteria." msgstr "" @@ -59,38 +59,38 @@ msgid "Create Lines from Move Lines" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Create Statement Lines" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_create_uid +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__create_uid msgid "Created by" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_create_date +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__create_date msgid "Created on" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_display_name +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__display_name msgid "Display Name" msgstr "" #. module: account_bank_statement_import_move_line #: selection:account.statement.line.create,date_type:0 -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_due_date +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__due_date msgid "Due Date" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_id +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__id msgid "ID" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.view_bank_statement_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.view_bank_statement_form msgid "Import Journal Items" msgstr "" @@ -100,48 +100,48 @@ msgid "Journal Item" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_journal_ids +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__journal_ids msgid "Journals Filter" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Keep empty for using all journals" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create___last_update +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create____last_update msgid "Last Modified on" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_write_uid +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__write_uid msgid "Last Updated by" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_write_date +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__write_date msgid "Last Updated on" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_invoice +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__invoice msgid "Linked to an Invoice or Refund" msgstr "" #. module: account_bank_statement_import_move_line #: selection:account.statement.line.create,date_type:0 -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_move_date +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__move_date msgid "Move Date" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_move_line_ids +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__move_line_ids msgid "Move Lines" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_partner_id +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__partner_id msgid "Partner Related" msgstr "" @@ -152,22 +152,22 @@ msgid "Select Move Lines to Create Statement" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Selected Move Lines to Create Lines" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_target_move +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__target_move msgid "Target Moves" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_move_line.account_statement_line_create_view_form msgid "Total Residual" msgstr "" #. module: account_bank_statement_import_move_line -#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create_date_type +#: model:ir.model.fields,field_description:account_bank_statement_import_move_line.field_account_statement_line_create__date_type msgid "Type of Date Filter" msgstr "" diff --git a/account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py b/account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py index 0c3f403b..f2eb42f2 100644 --- a/account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py +++ b/account_bank_statement_import_move_line/tests/test_account_bank_statement_import_move_line.py @@ -60,12 +60,8 @@ class TestAccountBankStatementImportMoveLine(common.SavepointCase): 'invoice': False, }) wizard.populate() - self.assertTrue(len(wizard.move_line_ids), 2) - wizard.invoice = True - wizard.move_line_filters_change() - wizard.populate() - self.assertTrue(len(wizard.move_line_ids), 1) - line = wizard.move_line_ids[0] + self.assertEqual(len(wizard.move_line_ids), 1) + line = wizard.move_line_ids self.assertEqual(line.debit, self.invoice.amount_total) wizard.create_statement_lines() line = self.statement.line_ids[0] diff --git a/account_bank_statement_import_move_line/wizards/account_statement_line_create.py b/account_bank_statement_import_move_line/wizards/account_statement_line_create.py index 8da23623..7a2e9d69 100644 --- a/account_bank_statement_import_move_line/wizards/account_statement_line_create.py +++ b/account_bank_statement_import_move_line/wizards/account_statement_line_create.py @@ -89,6 +89,7 @@ class AccountStatementLineCreate(models.TransientModel): def populate(self): domain = self._prepare_move_line_domain() lines = self.env['account.move.line'].search(domain) + self.move_line_ids = False self.move_line_ids = lines action = { 'name': _('Select Move Lines to Create Statement'),