first commit

This commit is contained in:
root
2026-03-14 09:42:12 +00:00
commit 0adbd20c2c
10991 changed files with 1646955 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.i18n import lazy_gettext
from trytond.model import fields
from trytond.pool import PoolMeta
class Company(metaclass=PoolMeta):
__name__ = 'company.company'
avatar_url = fields.Function(
fields.Char(lazy_gettext('ir.msg_avatar_url')), 'get_avatar_url')
def get_avatar_url(self, name):
return self.party.avatar_url
class Employee(metaclass=PoolMeta):
__name__ = 'company.employee'
avatar_url = fields.Function(
fields.Char(lazy_gettext('ir.msg_avatar_url')), 'get_avatar_url')
def get_avatar_url(self, name):
return self.party.avatar_url

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data depends="company">
<record model="ir.ui.view" id="company_view_list">
<field name="model">company.company</field>
<field name="inherit" ref="company.company_view_list"/>
<field name="name">company_list</field>
</record>
<record model="ir.ui.view" id="employee_view_list">
<field name="model">company.employee</field>
<field name="inherit" ref="company.employee_view_tree"/>
<field name="name">employee_list</field>
</record>
</data>
</tryton>

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,3 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"

View File

@@ -0,0 +1,9 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import avatar_mixin
from trytond.pool import PoolMeta
class Party(avatar_mixin(200, 'name'), metaclass=PoolMeta):
__name__ = 'party.party'

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="party_view_tree">
<field name="model">party.party</field>
<field name="inherit" ref="party.party_view_tree"/>
<field name="name">party_list</field>
</record>
<record model="ir.ui.view" id="party_view_form">
<field name="model">party.party</field>
<field name="inherit" ref="party.party_view_form"/>
<field name="name">party_form</field>
</record>
</data>
</tryton>

View File

@@ -0,0 +1,14 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
class User(metaclass=PoolMeta):
__name__ = 'res.user'
def get_avatar_badge_url(self, name):
url = super().get_avatar_badge_url(name)
if self.company:
url = self.company.avatar_url
return url

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,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.
try:
from trytond.modules.company.tests import CompanyTestMixin
except ImportError:
class CompanyTestMixin:
pass
from trytond.tests.test_tryton import ModuleTestCase
class PartyAvatarTestCase(CompanyTestMixin, ModuleTestCase):
'Test Party Avatar module'
module = 'party_avatar'
extras = ['company']
del ModuleTestCase

View File

@@ -0,0 +1,21 @@
[tryton]
version=7.8.0
depends:
ir
party
res
extras_depend:
company
xml:
party.xml
company.xml
[register]
model:
party.Party
[register company]
model:
company.Company
company.Employee
res.User

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//field[@name='party']" position="inside">
<prefix id="avatar" icon="avatar_url" icon_type="url" url_size="s" border="rounded"/>
</xpath>
</data>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//field[@name='party']" position="inside">
<prefix id="avatar" icon="avatar_url" icon_type="url" url_size="s" border="circle"/>
</xpath>
</data>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//group[@id='header']" position="after">
<field name="avatar" widget="image" height="100" width="100" xexpand="0" border="circle"/>
</xpath>
</data>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//field[@name='name']" position="inside">
<prefix id="avatar" icon="avatar_url" icon_type="url" url_size="s" border="circle"/>
</xpath>
</data>