[FIX] mail, email_template: prevent user from creating
authorThibault Delavallée <tde@openerp.com>
Wed, 13 Aug 2014 10:22:51 +0000 (12:22 +0200)
committerThibault Delavallée <tde@openerp.com>
Wed, 13 Aug 2014 11:43:27 +0000 (13:43 +0200)
templates in the templat_idm2o field on the wizard; prevent users from
creating models in the model_id m2o field on the template form view.

addons/email_template/email_template_view.xml
addons/email_template/wizard/mail_compose_message_view.xml

index 1002d96..47424e7 100644 (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)"/>
+                                <field name="model_id" required="1" on_change="onchange_model_id(model_id)" options="{'no_create': True}"/>
                                 <field name="model" invisible="1"/>
                             </group>
                         </div>
index 2f755a6..810aa54 100644 (file)
@@ -12,6 +12,7 @@
                         <div>Use template
                             <!--FIX: To avoid css issue of many2one field in footer temporary used oe_form (BUG:1152464)-->
                             <field name="template_id" nolabel="1" class='oe_inline'
+                                options="{'no_create': True}"
                                 on_change="onchange_template_id(template_id, composition_mode, model, res_id, context)" domain="[('model_id.model','=',model)]"
                                 context="{'default_model': model, 'default_body_html': body, 'default_subject': subject}"/>
                         </div>