Files
odoo_source/addons/payment/models/payment_method.py
T
Anita (anko) acb192eafb [IMP] payment: require name and image for payment method
Payment methods without image or without name does not make any sense.
Previously created payment methods without a name will be
given default name and ones without an image will be deleted.
Payment icon can no longer be created or edited from payment
provider form view.

task-2853424

closes odoo/odoo#105909

Related: odoo/upgrade#4043
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-26 18:50:52 +01:00

25 lines
886 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class PaymentMethod(models.Model):
_name = 'payment.method'
_description = 'Payment Method'
_order = 'sequence, name'
name = fields.Char(string="Name", required=True)
provider_ids = fields.Many2many(
string="Providers", comodel_name='payment.provider',
help="The list of providers supporting this payment method")
image = fields.Image(
string="Image",
max_width=64,
max_height=64,
required="True",
help="This field holds the image used for this payment method, limited to 64x64 px")
image_payment_form = fields.Image(
string="Image displayed on the payment form", related='image', store=True, max_width=45,
max_height=30)
sequence = fields.Integer('Sequence', default=1)