From 4db958989e9b5476399cf1b27ebcae3aeaa2ce45 Mon Sep 17 00:00:00 2001 From: "Nicolas (vin)" Date: Fri, 7 May 2021 08:27:18 +0000 Subject: [PATCH] [IMP] account: Extract payment methods into their own file The account payment file being quite big already, and the payment methods being modified in another task (2414749) we'll extract them into their own file to make it easier to work with them closes odoo/odoo#70937 Related: odoo/enterprise#18367 Signed-off-by: Laurent Smet --- addons/account/models/__init__.py | 1 + addons/account/models/account_payment.py | 11 ----------- addons/account/models/account_payment_method.py | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 addons/account/models/account_payment_method.py diff --git a/addons/account/models/__init__.py b/addons/account/models/__init__.py index 0322c41fd1d..f0bd1d9c573 100644 --- a/addons/account/models/__init__.py +++ b/addons/account/models/__init__.py @@ -16,6 +16,7 @@ from . import account_analytic_default from . import account_partial_reconcile from . import account_full_reconcile from . import account_payment +from . import account_payment_method from . import account_bank_statement from . import chart_template from . import account_analytic_line diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 30c9a4281d1..48be955235a 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -4,17 +4,6 @@ from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError -class AccountPaymentMethod(models.Model): - _name = "account.payment.method" - _description = "Payment Methods" - _order = 'sequence' - - name = fields.Char(required=True, translate=True) - code = fields.Char(required=True) # For internal identification - payment_type = fields.Selection([('inbound', 'Inbound'), ('outbound', 'Outbound')], required=True) - sequence = fields.Integer(help='Used to order Methods in the form view', default=10) - - class AccountPayment(models.Model): _name = "account.payment" _inherits = {'account.move': 'move_id'} diff --git a/addons/account/models/account_payment_method.py b/addons/account/models/account_payment_method.py new file mode 100644 index 00000000000..24de32ae15e --- /dev/null +++ b/addons/account/models/account_payment_method.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields + + +class AccountPaymentMethod(models.Model): + _name = "account.payment.method" + _description = "Payment Methods" + _order = 'sequence' + + name = fields.Char(required=True, translate=True) + code = fields.Char(required=True) # For internal identification + payment_type = fields.Selection([('inbound', 'Inbound'), ('outbound', 'Outbound')], required=True) + sequence = fields.Integer(help='Used to order Methods in the form view', default=10)