mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
@@ -1,4 +1,5 @@
|
||||
|
||||
from . import account_invoice
|
||||
from . import account_payment_method
|
||||
from . import account_payment_mode
|
||||
from . import account_journal
|
||||
|
||||
19
account_payment_mode/models/account_invoice.py
Normal file
19
account_payment_mode/models/account_invoice.py
Normal 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
|
||||
Reference in New Issue
Block a user