Files
odoo_source/odoo
Yannick Tivisse 265263dbce [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.
2018-08-24 11:05:22 +02:00
..
…
2018-07-24 16:58:14 +02:00
…
…