Add support for avatar

issue10085
review343561002
This commit is contained in:
Cédric Krier committed 2021-03-28 19:20:37 +02:00
1 parent 085f503927
commit c52f55d335
2 files changed
+15 -9

No files matched your search

+3 -2
View File
@@ -26,7 +26,8 @@ from sql.operators import Equal
from trytond.config import config
from trytond.exceptions import RateLimitException
from trytond.model import (
ModelView, ModelSQL, DeactivableMixin, fields, Unique, Exclude)
ModelView, ModelSQL, DeactivableMixin, fields, Unique, Exclude,
avatar_mixin)
from trytond.pool import Pool
from trytond.pyson import Eval
from trytond.report import Report, get_email
@@ -63,7 +64,7 @@ def _extract_params(url):
return urllib.parse.parse_qsl(urllib.parse.urlsplit(url).query)
class User(DeactivableMixin, ModelSQL, ModelView):
class User(avatar_mixin(100), DeactivableMixin, ModelSQL, ModelView):
'Web User'
__name__ = 'web.user'
_rec_name = 'email'
+12 -7
View File
@@ -2,13 +2,18 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<label name="party"/>
<field name="party"/>
<newline/>
<label name="email"/>
<field name="email"/>
<label name="active"/>
<field name="active"/>
<group col="4" colspan="3" yalign="0" id="header">
<label name="party"/>
<field name="party"/>
<label name="active"/>
<field name="active"/>
<label name="email"/>
<field name="email" widget="email"/>
<newline/>
</group>
<field name="avatar" widget="image" height="100" width="100" xexpand="0"/>
<label name="password"/>
<field name="password" widget="password"/>
<button name="reset_password" colspan="2"/>