<field name="zip" class="oe_inline" placeholder="ZIP"/>
<field name="city" class="oe_inline" placeholder="City"/>
</div>
- <field name="state_id" placeholder="State" options='{"no_open": true}'/>
- <field name="country_id" placeholder="Country" options='{"no_open": true}'/>
+ <field name="state_id" placeholder="State" options='{"no_open": True}'/>
+ <field name="country_id" placeholder="Country" options='{"no_open": True}'/>
</div>
</group>
<group name="bank" string="Information About the Bank">
<field name="street2"/>
<div>
<field name="city" placeholder="City" style="width: 40%%"/>
- <field name="state_id" class="oe_no_button" placeholder="State" style="width: 24%%" options='{"no_open": true}'/>
+ <field name="state_id" class="oe_no_button" placeholder="State" style="width: 24%%" options='{"no_open": True}'/>
<field name="zip" placeholder="ZIP" style="width: 34%%"/>
</div>
- <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": true}' on_change="on_change_country(country_id)"/>
+ <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}' on_change="on_change_country(country_id)"/>
</div>
<label for="rml_header1"/>
<div>
<group>
<field name="name"/>
<field name="code"/>
- <field name="country_id" options='{"no_open": true}'/>
+ <field name="country_id" options='{"no_open": True}'/>
</group>
</form>
</field>
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
- <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": true}'/>
+ <field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}'/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div>
- <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": true}'/>
+ <field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>
</div>
<field name="website" widget="url" placeholder="e.g. www.openerp.com"/>
</group>
<field name="email" widget="email"/>
<field name="title" domain="[('domain', '=', 'contact')]"
groups="base.group_no_one"
- options='{"no_open": true}' attrs="{'invisible': [('is_company','=', True)]}" />
+ options='{"no_open": True}' attrs="{'invisible': [('is_company','=', True)]}" />
</group>
</group>
import openerp.netsvc as netsvc
import openerp.tools as tools
from openerp.tools.config import config
-from openerp.tools.safe_eval import safe_eval as eval
+from openerp.tools.safe_eval import const_eval, safe_eval as eval
from openerp.tools.translate import _
from openerp import SUPERUSER_ID
from query import Query
field = model_fields.get(node.get('name'))
if field:
transfer_field_to_modifiers(field, modifiers)
-
+ if node.get('options'):
+ try:
+ node.set('options', simplejson.dumps(const_eval(node.get('options'))))
+ except Exception, msg:
+ raise except_orm('Invalide Python code in %s'%(node.get('options')), msg[0])
elif node.tag in ('form', 'tree'):
result = self.view_header_get(cr, user, False, node.tag, context)
_CONST_OPCODES = set(opmap[x] for x in [
'POP_TOP', 'ROT_TWO', 'ROT_THREE', 'ROT_FOUR', 'DUP_TOP', 'DUP_TOPX',
'POP_BLOCK','SETUP_LOOP', 'BUILD_LIST', 'BUILD_MAP', 'BUILD_TUPLE',
- 'LOAD_CONST', 'RETURN_VALUE', 'STORE_SUBSCR'] if x in opmap)
+ 'LOAD_CONST', 'RETURN_VALUE', 'STORE_SUBSCR', 'STORE_MAP', 'LOAD_NAME'] if x in opmap)
_EXPR_OPCODES = _CONST_OPCODES.union(set(opmap[x] for x in [
'UNARY_POSITIVE', 'UNARY_NEGATIVE', 'UNARY_NOT',