Commits

Raimon Esteve (Zikzakmedia) committed 4ed2843

ElectronicEmail add template field. Default is False (if template module was installed, don't show templates)

  • Participants
  • Parent commits afe0d0a

Comments (0)

Files changed (3)

+* ElectronicEmail add template field. Default is False (if template module was installed, don't show templates)
 * ElectronicEmail order by date DESC
 * Rename Model name. Replace _ to . (dot)
 * Add get_rec_name in ElectronicMail

electronic_mail.py

     flag_flagged = fields.Boolean('Flagged')
     flag_draft = fields.Boolean('Draft')
     flag_recent = fields.Boolean('Recent')
+    template = fields.Boolean('Template')
     size = fields.Integer('Size')
     mailbox_owner = fields.Function(
         fields.Many2One('res.user', 'Owner'),
     def default_flag_recent(self):
         return False
 
+    def default_template(self):
+        return False
+
     def get_rec_name(self, ids, name):
         if not ids:
             return {}

electronic_mail.xml

     <record model="ir.action.act_window" id="act_mail_form">
       <field name="name">Emails</field>
       <field name="res_model">electronic.mail</field>
+      <field name="domain">[('template', '=', False)]</field>
+      <field name="context">{'template': False}</field>
     </record>
     <record model="ir.action.act_window.view" id="act_mail_form_view1">
       <field name="sequence" eval="10"/>