mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Enable the payment methods by default on bank journals (including existing bank journals via post_install scripts)
Enable "Generate Accounting Entries On File Upload" by default
This commit is contained in:
committed by
Enric Tobella
parent
f43a9d3509
commit
60e0816c80
@@ -2,4 +2,5 @@
|
||||
|
||||
from . import account_payment_method
|
||||
from . import account_payment_mode
|
||||
from . import account_journal
|
||||
from . import res_partner_bank
|
||||
|
||||
24
account_payment_mode/models/account_journal.py
Normal file
24
account_payment_mode/models/account_journal.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
|
||||
def _default_outbound_payment_methods(self):
|
||||
all_out = self.env['account.payment.method'].search([
|
||||
('payment_type', '=', 'outbound')])
|
||||
return all_out
|
||||
|
||||
def _default_inbound_payment_methods(self):
|
||||
all_in = self.env['account.payment.method'].search([
|
||||
('payment_type', '=', 'inbound')])
|
||||
return all_in
|
||||
|
||||
outbound_payment_method_ids = fields.Many2many(
|
||||
default=_default_outbound_payment_methods)
|
||||
inbound_payment_method_ids = fields.Many2many(
|
||||
default=_default_inbound_payment_methods)
|
||||
Reference in New Issue
Block a user