Files
bank-payment/account_payment_order/models/account_journal.py
Thomas Binsfeld e2f51e7d00 [REF+IMP] account_payment_order: invoice addition + move generation + restrict payment modes selection on orders
- allow add to order from invoice if order exists
- payment line creation from move line
  Benefits of the batch creation of Odoo 12.0
  The method returns the created payment lines
- split generate_move method
- only payment order option on payment methods
  New option on payment methods: payment order only (unchecked by default) allowing to enforce the use of payment orders for some payment methods
2023-03-04 19:37:36 +01:00

34 lines
1.1 KiB
Python

# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountJournal(models.Model):
_inherit = 'account.journal'
inbound_payment_order_only = fields.Boolean(
compute='_compute_inbound_payment_order_only',
readonly=True,
store=True,
)
outbound_payment_order_only = fields.Boolean(
compute='_compute_outbound_payment_order_only',
readonly=True,
store=True,
)
@api.multi
@api.depends('inbound_payment_method_ids.payment_order_only')
def _compute_inbound_payment_order_only(self):
for rec in self:
rec.inbound_payment_order_only = all(
p.payment_order_only for p in rec.inbound_payment_method_ids)
@api.multi
@api.depends('outbound_payment_method_ids.payment_order_only')
def _compute_outbound_payment_order_only(self):
for rec in self:
rec.outbound_payment_order_only = all(
p.payment_order_only for p in rec.outbound_payment_method_ids)