[IMP] base_action_rule: improve view and server action should be one2many instead of many2many

bzr revid: hmo@tinyerp.com-20121005080325-3vcja1mog3yfthtr
This commit is contained in:
Harry (OpenERP)
2012-10-05 13:33:25 +05:30
parent ac4a137576
commit 82ab8bf9a3
2 changed files with 21 additions and 8 deletions
+7 -1
View File
@@ -93,7 +93,7 @@ trigger date, like sending a reminder 15 minutes before a meeting."),
'regex_name': fields.char('Regex on Resource Name', size=128, help="Regular expression for matching name of the resource\
\ne.g.: 'urgent.*' will search for records having name starting with the string 'urgent'\
\nNote: This is case sensitive search."),
'server_action_ids': fields.many2many('ir.actions.server', 'Server Action', help="Define Server actions.\neg:Email Reminders, Call Object Service, etc.."),
'server_action_ids': fields.one2many('ir.actions.server', 'action_rule_id', 'Server Action', help="Define Server actions.\neg:Email Reminders, Call Object Service, etc.."),
'filter_id':fields.many2one('ir.filters', 'Filter', required=False), #TODO: set domain [('model_id','=',model)]
'last_run': fields.datetime('Last Run', readonly=1),
}
@@ -321,6 +321,12 @@ trigger date, like sending a reminder 15 minutes before a meeting."),
base_action_rule()
class actions_server(osv.osv):
_inherit = 'ir.actions.server'
_columns = {
'action_rule_id': fields.many2one("base.action.rule", string="Action Rule")
}
actions_server()
class ir_cron(osv.osv):
_inherit = 'ir.cron'
@@ -15,7 +15,7 @@
<group col="4">
<field name="name"/>
<field name="model_id"/>
<field name="filter_id" domain="[('model_id','=',model_id)]"/>
<field name="filter_id" domain="[('model_id','=',model_id)]" context="{'default_model_id': model_id}"/>
<field name="sequence"/>
<field name="active"/>
</group>
@@ -47,16 +47,23 @@
</group>
</page>
<page string="Actions">
<group name="action_field" string="Fields to Change">
<group name="action_followers">
<field name="act_followers" widget="many2many_tags"/>
</group>
<group name="action_field" col="4" string="Fields to Change">
<field name="act_user_id"/>
<field name="act_state"/>
</group>
<group name="action_server" string="Server Action to be Triggered (eg. Email Reminder, Call Object Method, etc...)">
<field name="server_action_ids" domain="[('model_id','=', model_id)]" nolabel="1"/>
</group>
<group name="action_followers" string="Add Followers">
<field name="act_followers" widget="many2many_tags" nolabel="1"/>
<group name="action_server" string="Server Actions to be Triggered (eg. Email Reminder, Call Object Method, etc...)" >
<field name="server_action_ids" domain="[('model_id','=', model_id)]" nolabel="1" context="{'default_model_id': model_id}">
<tree string="Server Actions">
<field name="sequence"/>
<field name="name"/>
<field name="state"/>
</tree>
</field>
</group>
</page>
</notebook>
</form>