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.

Binary file not shown.

View File

@@ -0,0 +1,20 @@
# 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 ModelSQL, ModelView, fields, sequence_ordered
from trytond.pyson import Eval
class Action(sequence_ordered(), ModelSQL, ModelView):
__name__ = "dashboard.action"
user = fields.Many2One('res.user', "User", required=True)
act_window = fields.Many2One('ir.action.act_window', 'Action',
required=True, ondelete='CASCADE', domain=[
('res_model', '!=', None),
('res_model', '!=', ''),
('usage', '=', 'dashboard'),
# XXX copy ir.action rule to prevent access rule error
['OR',
('groups', 'in', Eval('context', {}).get('groups', [])),
('groups', '=', None),
],
])

View File

@@ -0,0 +1,28 @@
<?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="action_view_form">
<field name="model">dashboard.action</field>
<field name="type">form</field>
<field name="name">action_form</field>
</record>
<record model="ir.ui.view" id="action_view_tree">
<field name="model">dashboard.action</field>
<field name="type">tree</field>
<field name="priority" eval="10"/>
<field name="name">action_tree</field>
</record>
<record model="ir.ui.view" id="action_view_tree_sequence">
<field name="model">dashboard.action</field>
<field name="type">tree</field>
<field name="priority" eval="20"/>
<field name="name">action_tree_sequence</field>
</record>
</data>
</tryton>

128
modules/dashboard/ir.py Normal file
View File

@@ -0,0 +1,128 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import math
from lxml import etree
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
class View(metaclass=PoolMeta):
__name__ = 'ir.ui.view'
@staticmethod
def dashboard_id():
'''
Return the database id of view_dashboard
'''
ModelData = Pool().get('ir.model.data')
models_data = ModelData.search([
('fs_id', '=', 'view_dashboard'),
('module', '=', 'dashboard'),
], limit=1)
if not models_data:
return 0
model_data, = models_data
return model_data.db_id
@staticmethod
def _dashboard_element_action(action):
'''
Return etree Element for the given dashboard action.
'''
return etree.Element('action', {
'name': str(action.act_window.id),
})
@classmethod
def dashboard_view(cls, arch):
'''
Add action to view arch of dashboard
'''
User = Pool().get('res.user')
tree = etree.fromstring(arch)
root = tree.getroottree().getroot()
user = User(Transaction().user)
if user.dashboard_layout == 'square':
root.set('col', str(int(math.ceil(math.sqrt(
len(user.dashboard_actions))))))
for action in user.dashboard_actions:
root.append(cls._dashboard_element_action(action))
elif user.dashboard_layout == 'stack_right':
group = None
root.set('col', '2')
for action in user.dashboard_actions:
element = cls._dashboard_element_action(action)
if group is None:
root.append(element)
group = etree.Element('group', {
'col': '1',
'yexpand': '1',
'yfill': '1',
})
root.append(group)
else:
group.append(element)
elif user.dashboard_layout == 'stack_left':
root.set('col', '2')
group = etree.Element('group', {
'col': '1',
'yexpand': '1',
'yfill': '1',
})
root.append(group)
first = True
for action in user.dashboard_actions:
element = cls._dashboard_element_action(action)
if first:
first = False
root.append(element)
else:
group.append(element)
elif user.dashboard_layout == 'stack_top':
root.set('col', '1')
group = etree.Element('group', {
'col': str(len(user.dashboard_actions) - 1),
'xexpand': '1',
})
root.append(group)
first = True
for action in user.dashboard_actions:
element = cls._dashboard_element_action(action)
if first:
first = False
root.append(element)
else:
group.append(element)
elif user.dashboard_layout == 'stack_bottom':
root.set('col', '1')
group = etree.Element('group', {
'col': str(len(user.dashboard_actions) - 1),
'xexpand': '1',
})
first = True
for action in user.dashboard_actions:
element = cls._dashboard_element_action(action)
if first:
first = False
root.append(element)
else:
group.append(element)
root.append(group)
arch = etree.tostring(tree, encoding='utf-8').decode('utf-8')
return arch
@classmethod
def read(cls, ids, fields_names):
res = super().read(ids, fields_names)
if Transaction().user == 0:
return res
dashboard_id = cls.dashboard_id()
if fields_names is None \
or 'arch' in fields_names:
if dashboard_id in ids:
for res2 in res:
if res2['id'] == dashboard_id:
res2['arch'] = cls.dashboard_view(res2['arch'])
return res

30
modules/dashboard/ir.xml Normal file
View File

@@ -0,0 +1,30 @@
<?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="view_dashboard">
<field name="model" eval="None"/>
<field name="type">board</field>
<field name="name">dashboard</field>
</record>
<record model="ir.action.act_window" id="act_dashboard">
<field name="name">Dashboard</field>
<field name="res_model" eval="None"/>
<field name="type">ir.action.act_window</field>
</record>
<record model="ir.action.act_window.view" id="act_dashboard_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="view_dashboard"/>
<field name="act_window" ref="act_dashboard"/>
</record>
<menuitem
action="act_dashboard"
sequence="900"
id="menu_dashboard"
icon="tryton-board"/>
</data>
</tryton>

View File

@@ -0,0 +1,58 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Действие"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Потребител"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Действия на табло"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Подреждане на табло"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Действие на таблото"
#, fuzzy
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Каре"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Подравнени отдолу"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Подарнение отляво"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Подравнение отдясно"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Подравнени отгоре"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Табло"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Acció"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Usuari"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Accions de l'escriptori"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Organització de l'escriptori"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Acció de l'escriptori"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Escriptori"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Escriptori"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Ajustat"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "De dalt a baix"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "De dreta a esquerra"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "D'esquerra a dreta"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "De baix a dalt"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Escriptori"

View File

@@ -0,0 +1,57 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr ""
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr ""
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr ""
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr ""
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboard"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
#, fuzzy
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Aktion"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Benutzer"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Dashboard Aktionen"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Dashboard Anordnung"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboard Aktion"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Rechtecke"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Stapel unten"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Stapel links"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Stapel rechts"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Stapel oben"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Acción"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Usuario"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Acciones del escritorio"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Organización del escritorio"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Acción del escritorio"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Escritorio"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Escritorio"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Ajustado"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "De arriba a abajo"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "De derecha a izquierda"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "De izquierda a derecha"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "De abajo a arriba"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Escritorio"

View File

@@ -0,0 +1,59 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr ""
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr ""
#, fuzzy
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Acción del panel de control"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Organización del panel de control"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Acción del panel de control"
#, fuzzy
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Panel de control"
#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Panel de control"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Cuadrado"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Panel de control"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Toiming"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Kasutaja"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Töölaua toimingud"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Töölaua paigutus"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Töölaua toiming"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Töölaud"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Töölaud"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Ruut"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Paiguta alla"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Paiguta vasakule"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Paiguta paremale"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Paiguta üles"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Töölaud"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "اقدام"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "کاربر"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "اقدامات میزکار"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "چیدمان میزکار"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "اقدام میزکار"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "ميزكار"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "ميزكار"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "چهارگوش"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "قفسه پایین"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "قفسه چپ"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "قفسه راست"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "قفسه بالا"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "ميزكار"

View File

@@ -0,0 +1,57 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr ""
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr ""
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr ""
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr ""
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboard"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
#, fuzzy
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Action"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Utilisateur"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Actions tableau de bord"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Mise en page de tableau de bord"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Action de tableau de bord"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Tableau de bord"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Tableau de bord"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Carré"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Pile bas"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Pile gauche"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Pile droite"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Pile haut"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Tableau de bord"

View File

@@ -0,0 +1,59 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
#, fuzzy
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Művelet"
#, fuzzy
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Felhasználó"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr ""
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr ""
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboard"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
#, fuzzy
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Tindakan"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Pengguna"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr ""
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr ""
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr ""
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr ""
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr ""

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Azione"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Utente"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "azioni dashboard"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "layout dashboard"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "azione dashboard"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Quadrato"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "fondo della lista"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "lista sinistra"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "lista destra"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "cima della lista"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,58 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "ການປະຕິບັດ"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "ຜູ້ໃຊ້"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "ການປະຕິບັດກະດານບັນຊາ"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "ໂຄງກະດານບັນຊາ"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "ການປະຕິບັດກະດານບັນຊາ"
#, fuzzy
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "ສີ່ຫຼ່ຽມ"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "ແຖວຂໍ້ມູນລຸ່ມ"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "ແຖວຂໍ້ມູນຊ້າຍ"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "ແຖວຂໍ້ມູນຂວາ"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "ແຖວຂໍ້ມູນເທິງ"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "ກະດານບັນຊາ"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Veiksmas"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Naudotojas"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Skydelio veiksmai"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Skydelio išdėstymas"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Skydelio veiksmas"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Informacinis skydelis"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Informacinis skydelis"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Kvadratas"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Rikiuoti žemyn"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Rikiuoti kairėn"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Rikiuoti dešinėn"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Rikiuoti viršuje"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Informacinis skydelis"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Actie"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Gebruiker"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Prikbord acties"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Prikbord indeling"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboardactie"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Prikbord"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Prikbord"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Rechthoek"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Stapel onder"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Stapel links"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Stapel rechts"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Stapel boven"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Prikbord"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Akcja"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Użytkownik"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Akcje pulpitu"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Układ pulpitu"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Akcja pulpitu"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Pulpit"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Pulpit"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Kwadrat"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Stos u dołu"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Stos z lewej"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Stos z prawej"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Stos u góry"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Pulpit"

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Ação"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Usuário"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Ações do Painel"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Layout do Painel"
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Ação do Painel"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Painel"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Painel"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Quadrado"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Empilhar Embaixo"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Empilhar à Esquerda"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Empilhar à Direita"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Empilhar no Topo"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Painel"

View File

@@ -0,0 +1,61 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Acțiune"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Utilizator"
#, fuzzy
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Acțiuni din tabloul de bord"
#, fuzzy
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Aspect tablou de bord"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Acțiune tablou de bord"
#, fuzzy
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Tablou de Bord"
#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Tablou de bord"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Pătrat"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Stivă Jos"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Stivă Stânga"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Stivă Dreapta"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Stivă Sus"
#, fuzzy
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Tablou de bord"

View File

@@ -0,0 +1,58 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Действие"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Пользователь"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Панель действий"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Расположение на панели"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Панель действия"
#, fuzzy
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Квадрат"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Выровнять вниз"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Выровнять влево"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Выровнять вправо"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Выровнять вверх"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Информационная панель"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Ukrep"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Uporabnik"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Ukrepi delovne table"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Razporeditev delovne table"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Ukrep delovne table"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Delovna tabla"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Delovna tabla"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Kvadrat"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Zloženo spodaj"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Zloženo levo"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Zloženo desno"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Zloženo na vrhu"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Delovna tabla"

View File

@@ -0,0 +1,57 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr ""
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr ""
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr ""
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr ""
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Dashboard"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Dashboard"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr ""
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr ""
#, fuzzy
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Dashboard"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "Дія"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "Користувач"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "Дії панелі інструментів"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "Макет панелі інструментів"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "Дія панелі інструментів"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "Панель інструментів"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "Панель інструментів"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "Квадрат"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "Стопка знизу"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "Стопка зліва"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "Стопка справа"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "Стопка зверху"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "Панель інструментів"

View File

@@ -0,0 +1,56 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:dashboard.action,act_window:"
msgid "Action"
msgstr "操作"
msgctxt "field:dashboard.action,user:"
msgid "User"
msgstr "用户"
msgctxt "field:res.user,dashboard_actions:"
msgid "Dashboard Actions"
msgstr "看板操作"
msgctxt "field:res.user,dashboard_layout:"
msgid "Dashboard Layout"
msgstr "看板布局"
#, fuzzy
msgctxt "model:dashboard.action,string:"
msgid "Dashboard Action"
msgstr "看板操作"
msgctxt "model:ir.action,name:act_dashboard"
msgid "Dashboard"
msgstr "看板"
msgctxt "model:ir.ui.menu,name:menu_dashboard"
msgid "Dashboard"
msgstr "看板"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Square"
msgstr "正方形"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Bottom"
msgstr "靠下"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Left"
msgstr "靠左"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Right"
msgstr "靠右"
msgctxt "selection:res.user,dashboard_layout:"
msgid "Stack Top"
msgstr "靠上"
msgctxt "view:res.user:"
msgid "Dashboard"
msgstr "看板"

39
modules/dashboard/res.py Normal file
View File

@@ -0,0 +1,39 @@
# 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 ModelView, fields
from trytond.pool import Pool, PoolMeta
class User(metaclass=PoolMeta):
__name__ = "res.user"
dashboard_layout = fields.Selection([
('square', 'Square'),
('stack_right', 'Stack Right'),
('stack_left', 'Stack Left'),
('stack_top', 'Stack Top'),
('stack_bottom', 'Stack Bottom'),
], string='Dashboard Layout')
dashboard_actions = fields.One2Many('dashboard.action', 'user',
'Dashboard Actions')
@classmethod
def __setup__(cls):
super().__setup__()
cls._preferences_fields += [
'dashboard_layout',
'dashboard_actions',
]
@staticmethod
def default_dashboard_layout():
return 'square'
@classmethod
def on_modification(cls, mode, users, field_names=None):
pool = Pool()
View = pool.get('ir.ui.view')
super().on_modification(mode, users, field_names=field_names)
if (mode == 'write'
and field_names & {'dashboard_layout', 'dashboard_actions'}):
View._view_get_cache.clear()
ModelView._fields_view_get_cache.clear()

22
modules/dashboard/res.xml Normal file
View File

@@ -0,0 +1,22 @@
<?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="user_view_form">
<field name="model">res.user</field>
<field name="type" eval="None"/>
<field name="inherit" ref="res.user_view_form"/>
<field name="name">user_form</field>
</record>
<record model="ir.ui.view" id="user_view_form_preferences">
<field name="model">res.user</field>
<field name="type" eval="None"/>
<field name="inherit" ref="res.user_view_form_preferences"/>
<field name="name">user_form_preferences</field>
</record>
</data>
</tryton>

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,22 @@
# 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 Pool
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
class DashboardTestCase(ModuleTestCase):
'Test Dashboard module'
module = 'dashboard'
@with_transaction()
def test_view_read(self):
'Test dashboard view read'
pool = Pool()
View = pool.get('ir.ui.view')
dashboard_id = View.dashboard_id()
result, = View.read([dashboard_id], ['arch'])
self.assertIn('board', result['arch'])
del ModuleTestCase

View File

@@ -0,0 +1,15 @@
[tryton]
version=7.8.1
depends:
ir
res
xml:
dashboard.xml
res.xml
ir.xml
[register]
model:
ir.View
res.User
dashboard.Action

View File

@@ -0,0 +1,12 @@
<?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. -->
<form>
<label name="user"/>
<field name="user"/>
<newline/>
<label name="act_window"/>
<field name="act_window" widget="selection"/>
<label name="sequence"/>
<field name="sequence"/>
</form>

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. -->
<tree>
<field name="user"/>
<field name="sequence"/>
<field name="act_window"/>
</tree>

View File

@@ -0,0 +1,6 @@
<?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. -->
<tree sequence="sequence">
<field name="act_window" expand="1"/>
</tree>

View File

@@ -0,0 +1,5 @@
<?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. -->
<board>
</board>

View File

@@ -0,0 +1,13 @@
<?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="/form/notebook" position="inside">
<page string="Dashboard" id="dashboard" col="2">
<label name="dashboard_layout"/>
<field name="dashboard_layout"/>
<field name="dashboard_actions" colspan="2"
view_ids="dashboard.action_view_tree_sequence"/>
</page>
</xpath>
</data>

View File

@@ -0,0 +1,13 @@
<?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="/form/notebook" position="inside">
<page string="Dashboard" id="dashboard" col="2">
<label name="dashboard_layout"/>
<field name="dashboard_layout"/>
<field name="dashboard_actions" colspan="2"
view_ids="dashboard.action_view_tree_sequence"/>
</page>
</xpath>
</data>