Implement Objects for the Server Write / Create Option

Implement View for the new Objects

bzr revid: mga@tinyerp.com-20080825105515-htkpw9kab5sh4wjb
This commit is contained in:
mga@tinyerp.com
2008-08-25 16:25:15 +05:30
parent 476f91a116
commit 785a372fbc
2 changed files with 36 additions and 0 deletions
+17
View File
@@ -1063,6 +1063,23 @@
<label colspan="4" string="Access all the fields related to the current object easily just by defining name of the attribute, i.e. [[partner_id.name]] for Invoice Object"/>
</page>
<page string="Create / Write" attrs="{'invisible':[('state','=','python'),('state','=','dummy'),('state','=','trigger'), ('state','=','sms'), ('state','=','email'), ('state','=','client_action'), ('state','=','other')]}">
<separator colspan="4" string="Fields Mapping"/>
<field name="srcmodel_id" select="2"/>
<field name="fields_lines" nolabel="1" select="2" colspan="4">
<tree string="Field Mappings" editable="top">
<field name="col1" domain="[('model_id','=',parent.srcmodel_id)]"/>
<field name="type"/>
<field name="value"/>
</tree>
<form string="Field Mapping">
<field name="col1" domain="[('model_id','=',parent.srcmodel_id)]"/>
<field name="type"/>
<field name="value" colapsn="4"/>
</form>
</field>
</page>
<page string="Other Actions" attrs="{'invisible':[('state','!=','other')]}">
<separator colspan="4" string="Other Actions Configuration"/>
<field name="child_ids" nolabel="1" colspan="4" />
+19
View File
@@ -333,6 +333,23 @@ class ir_model_fields(osv.osv):
ir_model_fields()
class server_object_lines(osv.osv):
_name = 'ir.server.object.lines'
_sequence = 'ir_actions_id_seq'
_columns = {
'server_id': fields.many2one('ir.actions.server', 'Object Mapping'),
'col1': fields.many2one('ir.model.fields', 'Destination', required=True),
'value': fields.text('Value', required=True),
'type': fields.selection([
('value','Value'),
('equation','Formula')
], 'Type', required=True, size=32, change_default=True),
}
_defaults = {
'type': lambda *a: 'equation',
}
server_object_lines()
##
# Actions that are run on the server side
#
@@ -363,6 +380,8 @@ class actions_server(osv.osv):
'child_ids': fields.one2many('ir.actions.actions', 'parent_id', 'Others Actions'),
'usage': fields.char('Action Usage', size=32),
'type': fields.char('Report Type', size=32, required=True),
'srcmodel_id': fields.many2one('ir.model', 'Model', required=True),
'fields_lines': fields.one2many('ir.server.object.lines', 'server_id', 'Fields Mapping'),
}
_defaults = {
'state': lambda *a: 'dummy',