activate the python code in the server action

bzr revid: mga@tinyerp.com-20081216101809-ki2d8z3869qsm3dx
This commit is contained in:
Mantavya Gajjar 2008-12-16 15:48:09 +05:30
parent 7138dd4434
commit d8e954618d
2 changed files with 17 additions and 0 deletions

View File

@ -1142,6 +1142,12 @@
<field name="model_id" select="1"/>
<field name="sequence" select="2"/>
<notebook colspan="4">
<page string="Python Code" attrs="{'invisible':[('state','!=','code')]}">
<separator colspan="4" string="Python Code"/>
<field name="code" colspan="4" nolabel="1"/>
</page>
<page string="Trigger" attrs="{'invisible':[('state','!=','trigger')]}">
<separator colspan="4" string="Trigger Configuration"/>
<field name="wkf_model_id"/>

View File

@ -390,6 +390,7 @@ class actions_server(osv.osv):
'state': fields.selection([
('client_action','Client Action'),
('dummy','Dummy'),
('code','Python Code'),
('trigger','Trigger'),
('email','Email'),
('sms','SMS'),
@ -397,6 +398,7 @@ class actions_server(osv.osv):
('object_write','Write Object'),
('other','Multi Actions'),
], 'Action State', required=True, size=32),
'code':fields.text('Python Code'),
'sequence': fields.integer('Sequence'),
'model_id': fields.many2one('ir.model', 'Object', required=True),
'action_id': fields.many2one('ir.actions.actions', 'Client Action'),
@ -418,6 +420,15 @@ class actions_server(osv.osv):
'state': lambda *a: 'dummy',
'type': lambda *a: 'ir.actions.server',
'sequence': lambda *a: 5,
'code': lambda *a: """# You can use the following variables
# - object
# - object2
# - time
# - cr
# - uid
# - ids
# If you plan to return an action, assign: action = {...}
""",
}