[FIX] Move attributes to from 'states' dictionary to view

This commit is contained in:
Stefan Rijnhart
2013-05-29 16:42:50 +02:00
parent 1aac39a952
commit 08436c0bf5
2 changed files with 7 additions and 12 deletions

View File

@@ -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.

View File

@@ -21,6 +21,13 @@
position="attributes">
<attribute name="name">launch_wizard</attribute>
</xpath>
<!-- Communication only used for 'structured' communication -->
<xpath expr="//field[@name='line_ids']/form//field[@name='communication']"
position="attributes">
<attribute name="attrs">{
'readonly': [('state', '=', 'normal')]
}</attribute>
</xpath>
</data>
</field>
</record>