[FIX] mail: mail_template: issues linked to the migration

- do not browse a browse record
- removed onchange from the form view, as they are managed directly by the new API
This commit is contained in:
Thibault Delavallée
2015-04-29 17:20:12 +02:00
parent d62cc5eda4
commit 53e1fc5d87
2 changed files with 5 additions and 8 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ class MailTemplate(models.Model):
def onchange_model_id(self):
# TDE CLEANME: should'nt it be a stored related ?
if self.model_id:
self.model = self.env['ir.model'].browse(self.model_id).model
self.model = self.model_id.model
else:
self.model = False
+4 -7
View File
@@ -10,7 +10,7 @@
<div class="oe_title">
<label for="name" class="oe_edit_only"/><h1><field name="name" required="1"/></h1>
<group>
<field name="model_id" required="1" on_change="onchange_model_id(model_id)" options="{'no_create': True}"/>
<field name="model_id" required="1" options="{'no_create': True}"/>
<field name="model" invisible="1"/>
</group>
</div>
@@ -67,15 +67,12 @@
<page string="Dynamic Placeholder Generator">
<group>
<field name="model_object_field"
domain="[('model_id','=',model_id),('ttype','!=','one2many'),('ttype','!=','many2many')]"
on_change="onchange_sub_model_object_value_field(model_object_field)"/>
domain="[('model_id','=',model_id),('ttype','!=','one2many'),('ttype','!=','many2many')]"/>
<field name="sub_object" readonly="1"/>
<field name="sub_model_object_field"
domain="[('model_id','=',sub_object),('ttype','!=','one2many'),('ttype','!=','many2many')]"
attrs="{'readonly':[('sub_object','=',False)],'required':[('sub_object','!=',False)]}"
on_change="onchange_sub_model_object_value_field(model_object_field,sub_model_object_field)"/>
<field name="null_value"
on_change="onchange_sub_model_object_value_field(model_object_field,sub_model_object_field,null_value)"/>
attrs="{'readonly':[('sub_object','=',False)],'required':[('sub_object','!=',False)]}"/>
<field name="null_value"/>
<field name="copyvalue"/>
</group>
</page>