From 08436c0bf5231ebeb9f6548565931fb4669c4fc8 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 29 May 2013 16:42:50 +0200 Subject: [PATCH] [FIX] Move attributes to from 'states' dictionary to view --- account_banking_payment/model/payment_line.py | 12 ------------ account_banking_payment/view/account_payment.xml | 7 +++++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/account_banking_payment/model/payment_line.py b/account_banking_payment/model/payment_line.py index 4edcd9199..3abae5ff0 100644 --- a/account_banking_payment/model/payment_line.py +++ b/account_banking_payment/model/payment_line.py @@ -66,18 +66,6 @@ class payment_line(orm.Model): 'msg': '', } - def fields_get(self, cr, uid, fields=None, context=None): - res = super(payment_line, self).fields_get(cr, uid, fields, context) - if 'communication' in res: - res['communication'].setdefault('states', {}) - res['communication']['states']['structured'] = [('required', True)] - if 'communication2' in res: - res['communication2'].setdefault('states', {}) - res['communication2']['states']['structured'] = [('readonly', True)] - res['communication2']['states']['normal'] = [('readonly', False)] - - return res - """ Hooks for processing direct debit orders, such as implemented in account_direct_debit module. diff --git a/account_banking_payment/view/account_payment.xml b/account_banking_payment/view/account_payment.xml index 1d6b3c1e9..4f7601332 100644 --- a/account_banking_payment/view/account_payment.xml +++ b/account_banking_payment/view/account_payment.xml @@ -21,6 +21,13 @@ position="attributes"> launch_wizard + + + { + 'readonly': [('state', '=', 'normal')] + } +