diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-08-24 11:05:22 +0200 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-08-24 11:05:22 +0200 |
| commit | 265263dbce6c117eeac825c114df90ec9a8375ba (patch) | |
| tree | 8fc26a7eb0547a2a3e89fce9c10c0d453fb12f47 /addons/account_tax_python/__init__.py | |
| parent | c3e8fe5da162bebe29a21f4662a5022c0c9bc343 (diff) | |
[FIX] base: Set a default email address for admin
Purpose
=======
Currently, as the admin as no email address, it's now impossible to install
the mail module without demo data, because of the following data:
<record model="mail.message" id="module_install_notification" context="{'mail_notify_noemail': True}">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
<field name="message_type">email</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">Welcome to Odoo!</field>
<field name="body"><![CDATA[<p>Welcome to the #general channel.</p>
<p>This channel is accessible to all users to <b>easily share company information</b>.</p>]]></field>
</record>
Because when creating a mail.message a user error is raised if no email address is found.
@api.model
def _get_default_from(self):
if self.env.user.email:
return formataddr((self.env.user.name, self.env.user.email))
raise UserError(_("Unable to post message, please configure the sender's email address."))
In a general way, all the users should have an email address.
Diffstat (limited to 'addons/account_tax_python/__init__.py')
0 files changed, 0 insertions, 0 deletions
