From 71d1e3883d62476ff98633fa96464229613e75c7 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 10 May 2016 23:16:31 +0200 Subject: [PATCH] Move fields mandate_required and export_ascii from payment mode to payment method Display chatter on payment orders Several small usability improvements --- .../models/account_payment_method.py | 5 +++++ .../models/account_payment_mode.py | 5 ----- .../models/account_payment_order.py | 11 +++++++---- .../views/account_payment_method.xml | 2 ++ .../views/account_payment_mode.xml | 1 - 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_method.py b/account_banking_pain_base/models/account_payment_method.py index 90b485fa0..2d517e3db 100644 --- a/account_banking_pain_base/models/account_payment_method.py +++ b/account_banking_pain_base/models/account_payment_method.py @@ -10,6 +10,11 @@ class AccountPaymentMethod(models.Model): _inherit = 'account.payment.method' pain_version = fields.Selection([], string='PAIN Version') + convert_to_ascii = fields.Boolean( + string='Convert to ASCII', default=True, + help="If active, Odoo will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file.") @api.multi def get_xsd_file_path(self): diff --git a/account_banking_pain_base/models/account_payment_mode.py b/account_banking_pain_base/models/account_payment_mode.py index fd36ea3cd..e0e628a59 100644 --- a/account_banking_pain_base/models/account_payment_mode.py +++ b/account_banking_pain_base/models/account_payment_mode.py @@ -10,11 +10,6 @@ from openerp import models, fields class AccountPaymentMode(models.Model): _inherit = 'account.payment.mode' - convert_to_ascii = fields.Boolean( - string='Convert to ASCII', default=True, - help="If active, Odoo will convert each accented caracter to " - "the corresponding unaccented caracter, so that only ASCII " - "caracters are used in the generated PAIN file.") initiating_party_issuer = fields.Char( string='Initiating Party Issuer', size=35, help="This will be used as the 'Initiating Party Issuer' in the " diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index a7e7106b9..d4ea8e6e5 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -10,14 +10,15 @@ class AccountPaymentOrder(models.Model): _inherit = 'account.payment.order' sepa = fields.Boolean( - compute='compute_sepa', readonly=True, - string="SEPA Payment") + compute='compute_sepa', readonly=True, string="SEPA Payment") charge_bearer = fields.Selection([ ('SLEV', 'Following Service Level'), ('SHAR', 'Shared'), ('CRED', 'Borne by Creditor'), ('DEBT', 'Borne by Debtor')], string='Charge Bearer', - default='SLEV', + default='SLEV', readonly=True, + states={'draft': [('readonly', False)], 'open': [('readonly', False)]}, + track_visibility='onchange', help="Following service level : transaction charges are to be " "applied following the rules agreed in the service level " "and/or scheme (SEPA Core messages must use this). Shared : " @@ -28,7 +29,9 @@ class AccountPaymentOrder(models.Model): "by debtor : all transaction charges are to be borne by the " "debtor.") batch_booking = fields.Boolean( - string='Batch Booking', + string='Batch Booking', readonly=True, + states={'draft': [('readonly', False)], 'open': [('readonly', False)]}, + track_visibility='onchange', help="If true, the bank statement will display only one debit " "line for all the wire transfers of the SEPA XML file ; if " "false, the bank statement will display one debit line per wire " diff --git a/account_banking_pain_base/views/account_payment_method.xml b/account_banking_pain_base/views/account_payment_method.xml index 7a9e65982..8d223b2b0 100644 --- a/account_banking_pain_base/views/account_payment_method.xml +++ b/account_banking_pain_base/views/account_payment_method.xml @@ -10,6 +10,8 @@ + diff --git a/account_banking_pain_base/views/account_payment_mode.xml b/account_banking_pain_base/views/account_payment_mode.xml index d92a5e786..cc7346dd6 100644 --- a/account_banking_pain_base/views/account_payment_mode.xml +++ b/account_banking_pain_base/views/account_payment_mode.xml @@ -16,7 +16,6 @@ -