diff --git a/CHANGELOG b/CHANGELOG index d0d6849f3d..4f884f08ff 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Allow to use XML file for views * Add RPC definition * Repace BrowseRecord by Model instance * Replace Cache decorator by a simple LRU Cache diff --git a/MANIFEST.in b/MANIFEST.in index 5dd29adf4f..cd0aa79aa3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,6 +12,7 @@ include etc/* include trytond/backend/*/init.sql include trytond/ir/tryton.cfg include trytond/ir/*.xml +include trytond/ir/view/*.xml include trytond/ir/locale/*.po include trytond/ir/module/*.xml include trytond/ir/ui/*.xml @@ -20,9 +21,11 @@ include trytond/ir/ui/*.rnc include trytond/ir/ui/icons/*.svg include trytond/res/tryton.cfg include trytond/res/*.xml +include trytond/res/view/*.xml include trytond/res/locale/*.po include trytond/test/tryton.cfg include trytond/test/*.xml include trytond/webdav/tryton.cfg include trytond/webdav/*.xml +include trytond/webdav/view/*.xml include trytond/webdav/locale/*.po diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index 5c6e663a0f..f0b773ef40 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -4,15 +4,17 @@ Views ===== -The views are used to display records of an object to the user. +The views are used to display records of an :class:`ModelView +` to the user. -In Tryton, objects can have several views. An `action` opens a window and -defines which view to show. +In Tryton, :class:`ModelView ` can have several views. +An `action` opens a window and defines which view to show. -The views are built from XML that is stored in the databases with the object -ir.ui.view. +The views are built from XML that is stored in the `view` directory of the +module or in the databases thanks to the model ir.ui.view. -So generally, they are defined in xml files with this kind of xml: +So generally, they are defined in xml files with this kind of xml where name is +the name of the XML file in the `view` directory: .. highlight:: xml @@ -23,11 +25,7 @@ So generally, they are defined in xml files with this kind of xml: type name - - - + view_name diff --git a/setup.py b/setup.py index f3088e0d65..6384c05576 100644 --- a/setup.py +++ b/setup.py @@ -26,11 +26,11 @@ setup(name=PACKAGE, 'trytond.backend.mysql': ['init.sql'], 'trytond.backend.postgresql': ['init.sql'], 'trytond.backend.sqlite': ['init.sql'], - 'trytond.ir': ['tryton.cfg', '*.xml', 'locale/*.po'], + 'trytond.ir': ['tryton.cfg', '*.xml', 'view/*.xml', 'locale/*.po'], 'trytond.ir.module': ['*.xml'], 'trytond.ir.ui': ['*.xml', '*.rng', '*.rnc'], - 'trytond.res': ['tryton.cfg', '*.xml', 'locale/*.po'], - 'trytond.webdav': ['tryton.cfg', '*.xml', 'locale/*.po'], + 'trytond.res': ['tryton.cfg', '*.xml', 'view/*.xml', 'locale/*.po'], + 'trytond.webdav': ['tryton.cfg', '*.xml', 'view/*.xml', 'locale/*.po'], 'trytond.test': ['tryton.cfg', '*.xml'], }, scripts=['bin/trytond'], diff --git a/trytond/backend/mysql/init.sql b/trytond/backend/mysql/init.sql index fb274089df..797b6a80c1 100644 --- a/trytond/backend/mysql/init.sql +++ b/trytond/backend/mysql/init.sql @@ -24,7 +24,7 @@ CREATE TABLE ir_ui_view ( id BIGINT AUTO_INCREMENT NOT NULL, model VARCHAR(255) NOT NULL, type VARCHAR(255), - arch TEXT NOT NULL, + data TEXT NOT NULL, field_childs VARCHAR(255), priority BIGINT NOT NULL default 0, PRIMARY KEY(id) diff --git a/trytond/backend/postgresql/init.sql b/trytond/backend/postgresql/init.sql index 407b1cc841..a82b3f201a 100644 --- a/trytond/backend/postgresql/init.sql +++ b/trytond/backend/postgresql/init.sql @@ -30,7 +30,7 @@ CREATE TABLE ir_ui_view ( id INTEGER DEFAULT NEXTVAL('ir_ui_view_id_seq') NOT NULL, model VARCHAR NOT NULL, "type" VARCHAR, - arch TEXT NOT NULL, + data TEXT NOT NULL, field_childs VARCHAR, priority INTEGER NOT NULL, PRIMARY KEY(id) diff --git a/trytond/backend/sqlite/init.sql b/trytond/backend/sqlite/init.sql index 055e4f8ce2..52f6239520 100644 --- a/trytond/backend/sqlite/init.sql +++ b/trytond/backend/sqlite/init.sql @@ -22,7 +22,7 @@ CREATE TABLE ir_ui_view ( id INTEGER PRIMARY KEY AUTOINCREMENT, model VARCHAR, "type" VARCHAR, - arch TEXT, + data TEXT, field_childs VARCHAR, priority INTEGER ); diff --git a/trytond/ir/action.xml b/trytond/ir/action.xml index 5e4fc84a33..ff78767535 100644 --- a/trytond/ir/action.xml +++ b/trytond/ir/action.xml @@ -7,42 +7,12 @@ this repository contains the full copyright notices and license terms. --> ir.action form - - - ir.action tree - - - - - - ]]> - + action_list Actions @@ -67,93 +37,24 @@ this repository contains the full copyright notices and license terms. --> ir.action.keyword tree - - - - - - - ]]> - + action_keyword_list ir.action.keyword form - - - ir.action.report form - - - ir.action.report tree - - - - - - - - ]]> - + action_report_list Reports @@ -178,59 +79,12 @@ this repository contains the full copyright notices and license terms. --> ir.action.act_window form - - - ir.action.act_window tree - - - - - - - ]]> - + action_act_window_list Window Actions @@ -253,96 +107,32 @@ this repository contains the full copyright notices and license terms. --> ir.action.act_window.view form - - - ir.action.act_window.view tree - - - - - - - ]]> - + action_act_window_view_list ir.action.act_window.view tree - - - - - - ]]> - + action_act_window_view_list2 ir.action.wizard form - - - ir.action.wizard tree - - - - - - - ]]> - + action_wizard_list Wizards @@ -367,43 +157,12 @@ this repository contains the full copyright notices and license terms. --> ir.action.url form - - - ir.action.url tree - - - - - - - ]]> - + action_url_list URLs diff --git a/trytond/ir/attachment.xml b/trytond/ir/attachment.xml index 6899042aec..789d26dc34 100644 --- a/trytond/ir/attachment.xml +++ b/trytond/ir/attachment.xml @@ -6,53 +6,12 @@ this repository contains the full copyright notices and license terms. --> ir.attachment form - - - - - - - - - - - - - - ]]> - + attachment_form ir.attachment tree - - - - - - - - - - ]]> - + attachment_list Attachments diff --git a/trytond/ir/cron.xml b/trytond/ir/cron.xml index 4faa070458..cc1ca464f5 100644 --- a/trytond/ir/cron.xml +++ b/trytond/ir/cron.xml @@ -9,56 +9,12 @@ this repository contains the full copyright notices and license terms. --> ir.cron tree - - - - - - - - - - - - ]]> - + cron_list ir.cron form - - - Scheduled Actions diff --git a/trytond/ir/export.xml b/trytond/ir/export.xml index 857dbe627c..01f5b05792 100644 --- a/trytond/ir/export.xml +++ b/trytond/ir/export.xml @@ -6,29 +6,12 @@ this repository contains the full copyright notices and license terms. --> ir.export form - - - ir.export tree - - - - - - ]]> - + export_list Exports diff --git a/trytond/ir/lang.xml b/trytond/ir/lang.xml index 60bf7adefa..d361827651 100644 --- a/trytond/ir/lang.xml +++ b/trytond/ir/lang.xml @@ -92,47 +92,12 @@ this repository contains the full copyright notices and license terms. --> ir.lang tree - - - - - - - - - ]]> - + lang_list ir.lang form - - - Languages diff --git a/trytond/ir/model.xml b/trytond/ir/model.xml index ae170d68c7..d2806ac542 100644 --- a/trytond/ir/model.xml +++ b/trytond/ir/model.xml @@ -7,35 +7,12 @@ this repository contains the full copyright notices and license terms. --> ir.model form - - - ir.model tree - - - - - - - - ]]> - + model_list Models @@ -58,42 +35,12 @@ this repository contains the full copyright notices and license terms. --> ir.model.field form - - - ir.model.field tree - - - - - - - - - - ]]> - + model_field_list Fields @@ -116,43 +63,12 @@ this repository contains the full copyright notices and license terms. --> ir.model.access tree - - - - - - - - - - ]]> - + model_access_list ir.model.access form - - - Models Access @@ -176,44 +92,13 @@ this repository contains the full copyright notices and license terms. --> ir.model.field.access tree - - - - - - - - - - ]]> - + model_field_access_list ir.model.field.access form - - - @@ -244,16 +129,7 @@ this repository contains the full copyright notices and license terms. --> ir.model.print_model_graph.start form - - - @@ -270,29 +146,12 @@ this repository contains the full copyright notices and license terms. --> ir.model.button tree - - - - - - ]]> - + model_button_list ir.model.button form - - - diff --git a/trytond/ir/module/module.xml b/trytond/ir/module/module.xml index 79ad2644df..e93f3042fa 100644 --- a/trytond/ir/module/module.xml +++ b/trytond/ir/module/module.xml @@ -7,45 +7,12 @@ this repository contains the full copyright notices and license terms. --> ir.module.module form - - -