1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/l10n_nz_eft/models/account_payment_method.py
2024-12-10 09:04:09 +07:00

47 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class AccountPaymentMethod(models.Model):
_inherit = 'account.payment.method'
# ----------------
# Business methods
# ----------------
@api.model
def _get_payment_method_information(self):
# EXTENDS account
res = super()._get_payment_method_information()
for payment_method in ('l10n_nz_eft_in', 'l10n_nz_eft_out'):
res[payment_method] = {
'mode': 'multi',
'domain': [('type', '=', 'bank')],
'currency_ids': self.env.ref("base.NZD").ids,
}
return res
class AccountPaymentMethodLine(models.Model):
_inherit = 'account.payment.method.line'
# ------------------
# Fields declaration
# ------------------
# Adding it here in order to leave as much freedom as possible to the user.
# Possible to add multiple methods depending on what is wanted.
l10n_nz_payment_listing_indicator = fields.Selection(
selection=[
('C', 'C'),
('I', 'I'),
('O', 'O'),
],
string='Payment Listing Indicator',
help="Bulk Listing = combine all transactions contained in the file and show as one transaction on the payers bank statement.\n"
"C = Individual listing, details copied from other party.\n"
"I = Individual listing, payers and other partys details entered individually.\n"
"O = Individual listing, payers details all the same."
)