[IMP] gamification: domain for type form

bzr revid: mat@openerp.com-20130218151607-22gv890c1adecpql
This commit is contained in:
Martin Trigaux 2013-02-18 16:16:07 +01:00
parent c4e48dbd02
commit d80e4909e4
2 changed files with 12 additions and 12 deletions

View File

@ -89,13 +89,13 @@ class gamification_goal_type(osv.Model):
- 'Count' for the number of entries\n
- 'Manually' for user defined values""",
required=True),
'object': fields.many2one('ir.model',
string='Object',
help='The object type for the field to evaluate' ),
'field': fields.many2one('ir.model.fields',
'model_id': fields.many2one('ir.model',
string='Modeel',
help='The model object for the field to evaluate' ),
'field_id': fields.many2one('ir.model.fields',
string='Evaluated Field',
help='The field containing the value to evaluate' ),
'field_date': fields.many2one('ir.model.fields',
'field_date_id': fields.many2one('ir.model.fields',
string='Evaluated Date Field',
help='The date to use for the time period evaluated'),
'domain': fields.char("Domain",

View File

@ -16,8 +16,6 @@
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="computation_mode"/>
<field name="field"/>
<field name="domain"/>
</tree>
</field>
</record>
@ -42,10 +40,12 @@
</group>
<group string="Computation">
<field name="computation_mode"/>
<field name="object"/>
<field name="field"/>
<field name="field_date"/>
<field name="domain"/>
<!-- Hide the fields beloz if manually -->
<field name="model_id" attrs="{'invisible':[('computation_mode','=','manually')], 'required':[('computation_mode','!=','manually')]}"/>
<field name="field_id" attrs="{'invisible':[('computation_mode','=','manually')], 'required':[('computation_mode','!=','manually')]}" domain="[('model_id','=',model_id)]" />
<field name="field_date_id" attrs="{'invisible':[('computation_mode','=','manually')], 'required':[('computation_mode','!=','manually')]}" domain="[('ttype', 'in', ('date', 'datetime')), ('model_id','=',model_id)]"/>
<field name="domain" attrs="{'invisible':[('computation_mode','=','manually')], 'required':[('computation_mode','!=','manually')]}"/>
</group>
</group>
</sheet>
@ -59,7 +59,7 @@
<field name="arch" type="xml">
<search string="Search Goal Types">
<group expand="0" string="Group By...">
<filter string="Object" domain="[]" context="{'group_by':'object'}"/>
<filter string="Model" domain="[]" context="{'group_by':'model_id'}"/>
<filter string="Computation Mode" domain="[]" context="{'group_by':'computation_mode'}"/>
</group>
</search>