From cace39fc1866f29e757bf0b98471d036e3b3c6e8 Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Mon, 4 Jul 2016 11:30:29 +0200 Subject: [PATCH] Only set account_id if not set by parser --- account_move_bankaccount_import/README.rst | 1 + account_move_bankaccount_import/__init__.py | 1 + account_move_bankaccount_import/__openerp__.py | 1 + account_move_bankaccount_import/models/__init__.py | 1 + account_move_bankaccount_import/models/account_move.py | 1 + .../models/res_partner_bank.py | 1 + account_move_bankaccount_import/tests/__init__.py | 1 + .../tests/test_bankaccount_completion.py | 1 + account_move_base_import/models/account_journal.py | 9 +++++---- 9 files changed, 13 insertions(+), 4 deletions(-) diff --git a/account_move_bankaccount_import/README.rst b/account_move_bankaccount_import/README.rst index a25a0368..ce9a8d73 100644 --- a/account_move_bankaccount_import/README.rst +++ b/account_move_bankaccount_import/README.rst @@ -39,6 +39,7 @@ Contributors ------------ * Laurent Mignon +* Matthieu Dietrich Maintainer ---------- diff --git a/account_move_bankaccount_import/__init__.py b/account_move_bankaccount_import/__init__.py index 6216ea54..126485cb 100644 --- a/account_move_bankaccount_import/__init__.py +++ b/account_move_bankaccount_import/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from . import models diff --git a/account_move_bankaccount_import/__openerp__.py b/account_move_bankaccount_import/__openerp__.py index 667b819e..2b591b37 100644 --- a/account_move_bankaccount_import/__openerp__.py +++ b/account_move_bankaccount_import/__openerp__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) { 'name': "Journal Entry completion from bank account number", diff --git a/account_move_bankaccount_import/models/__init__.py b/account_move_bankaccount_import/models/__init__.py index 19c16c00..61ce482b 100644 --- a/account_move_bankaccount_import/models/__init__.py +++ b/account_move_bankaccount_import/models/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from . import account_move from . import res_partner_bank diff --git a/account_move_bankaccount_import/models/account_move.py b/account_move_bankaccount_import/models/account_move.py index ed882422..ba0aeb6f 100644 --- a/account_move_bankaccount_import/models/account_move.py +++ b/account_move_bankaccount_import/models/account_move.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from openerp import _, fields, models from openerp.addons.account_move_base_import.models.account_move \ diff --git a/account_move_bankaccount_import/models/res_partner_bank.py b/account_move_bankaccount_import/models/res_partner_bank.py index 740e497f..eadab7db 100644 --- a/account_move_bankaccount_import/models/res_partner_bank.py +++ b/account_move_bankaccount_import/models/res_partner_bank.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from openerp import api, models diff --git a/account_move_bankaccount_import/tests/__init__.py b/account_move_bankaccount_import/tests/__init__.py index 8f905942..17337560 100644 --- a/account_move_bankaccount_import/tests/__init__.py +++ b/account_move_bankaccount_import/tests/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from . import test_bankaccount_completion diff --git a/account_move_bankaccount_import/tests/test_bankaccount_completion.py b/account_move_bankaccount_import/tests/test_bankaccount_completion.py index d641f938..d89a887f 100644 --- a/account_move_bankaccount_import/tests/test_bankaccount_completion.py +++ b/account_move_bankaccount_import/tests/test_bankaccount_completion.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2013 ACSONE SA/NV +# © 2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from openerp.tests import common from openerp import fields, tools diff --git a/account_move_base_import/models/account_journal.py b/account_move_base_import/models/account_journal.py index 89cabc5b..231c27ba 100644 --- a/account_move_base_import/models/account_journal.py +++ b/account_move_base_import/models/account_journal.py @@ -29,8 +29,8 @@ class AccountJournal(models.Model): string='Type of import', default='generic_csvxls_so', required=True, - help="Choose here the method by which you want to import bank " - "statement for this profile.") + help="Choose here the method by which you want to import account " + "moves for this journal.") last_import_date = fields.Datetime( string="Last Import Date") @@ -59,7 +59,7 @@ class AccountJournal(models.Model): launch_import_completion = fields.Boolean( string="Launch completion after import", help="Tic that box to automatically launch the completion " - "on each imported file using this profile.") + "on each imported file using this journal.") def _get_rules(self): # We need to respect the sequence order @@ -190,7 +190,8 @@ class AccountJournal(models.Model): values['company_currency_id'] = self.company_id.currency_id.id values['journal_id'] = self.id values['move_id'] = move.id - values['account_id'] = self.receivable_account_id.id + if not values.get('account_id', False): + values['account_id'] = self.receivable_account_id.id values = move_line_obj._add_missing_default_values(values) return values