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>
24 lines
804 B
XML
24 lines
804 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<template id="website.test_template" name="test template 2">
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<t t-call-assets="website.test_bundle" t-js="False"/>
|
|
<meta/>
|
|
<t t-call-assets="website.test_bundle" t-css="False"/>
|
|
</head>
|
|
<body>
|
|
<img src="http://test.external.link/img.png"/>
|
|
<img src="/website/static/img.png"/>
|
|
<a href="http://test.external.link/link">x</a>
|
|
<a href="/web/content/local_link">x</a>
|
|
<span t-attf-style="background-image: url('/web/image/2')" t-att-empty="False">xxx</span>
|
|
<div widget="html" t-field="user.signature"/>
|
|
<div widget="image" t-field="user.avatar_1920" t-options="{'widget': 'image'}"/>
|
|
</body>
|
|
</html>
|
|
</template>
|
|
|
|
</odoo> |