Files
odoo_source/odoo/addons/base/data/res_users_data.xml
T
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00

45 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- user 1 is the technical admin user -->
<record model="res.users" id="base.user_root">
<field name="partner_id" ref="base.partner_root"/>
<field name="company_id" ref="main_company"/>
<field name="company_ids" eval="[Command.link(ref('main_company'))]"/>
<field name="email">root@example.com</field>
<field name="signature"><![CDATA[<span>-- <br/>
System</span>]]></field>
</record>
<!-- user 2 is the human admin user -->
<record id="user_admin" model="res.users">
<field name="login">admin</field>
<field name="password">admin</field>
<field name="partner_id" ref="base.partner_admin"/>
<field name="company_id" ref="main_company"/>
<field name="company_ids" eval="[Command.link(ref('main_company'))]"/>
<field name="groups_id" eval="[Command.set([])]"/>
<field name="signature"><![CDATA[<span>-- <br/>
Administrator</span>]]></field>
</record>
<!-- Default user with full access rights for newly created users -->
<record id="default_user" model="res.users">
<field name="name">Default User Template</field>
<field name="login">default</field>
<field name="active" eval="False"/>
</record>
<record id="public_user" model="res.users">
<field name="name">Public user</field>
<field name="login">public</field>
<field name="password"></field>
<!-- Avoid auto-including this demo user in any default group -->
<field name="groups_id" eval="[Command.set([])]"/>
<field name="image_1920" type="base64" file="base/static/img/public_user-image.png"/>
<field name="partner_id" ref="public_partner"/>
<field name="active" eval="False"/>
</record>
</data>
</odoo>