Merge PR #655 into 12.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2019-11-30 13:07:15 +00:00
2 changed files with 20 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
from . import account_invoice
from . import account_payment_method
from . import account_payment_mode
from . import account_journal

View File

@@ -0,0 +1,19 @@
# Copyright 2019 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
from odoo.tools import config
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
def _get_default_bank_id(self, type, company_id):
"""When OCA payment mode is used we don't want default bank acc"""
context = self.env.context
if config['test_enable'] and not context.get(
'test_account_payment_mode') or context.get(
'force_std_default_bank_id'):
return super()._get_default_bank_id(type, company_id)
else:
return False