Files
odoo_source/addons/website_partner/views/website_partner_templates.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

41 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="partner_page" name="Partner Page">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure" id="oe_structure_website_partner_partner_1"/>
<div class="container">
<div class="row">
<t t-call="website_partner.partner_detail"></t>
</div>
</div>
<div class="oe_structure" id="oe_structure_website_partner_partner_2"/>
</div>
</t>
</template>
<template id="partner_detail" name="Partner Details">
<h1 class="col-lg-12 text-center" id="partner_name" t-field="partner.display_name"/>
<div class="col-lg-4">
<div t-field="partner.avatar_1920" t-options='{"widget": "image", "preview_image": "avatar_512", "class": "d-block mx-auto mb16"}'/>
<address>
<div t-field="partner.self" t-options='{
"widget": "contact",
"fields": ["address", "website", "phone", "email"]
}'/>
</address>
<t t-out="left_column or ''"/>
</div>
<div class="col-lg-8 mt32">
<t t-if="partner">
<div t-field="partner.website_description"/>
<t groups="website.group_website_publisher">
<h2 class="css_non_editable_mode_hidden o_not_editable">Short Description for List View</h2>
<div class="css_non_editable_mode_hidden" t-field="partner.website_short_description"/>
</t>
</t>
<t t-out="right_column or ''"/>
</div>
</template>
</odoo>