From 67bfcde06f2a9db5a0fc69ff12a68b74f2cf8618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 7 Aug 2024 23:24:57 +0200 Subject: [PATCH] Update documentation of infrastructure Co-authored-by: David Harper --- trytond/doc/conf.py | 1 + trytond/doc/modules/index.rst | 1 + trytond/doc/modules/ir/design/action.inc.rst | 87 ++++++++++ .../doc/modules/ir/design/attachment.inc.rst | 19 +++ trytond/doc/modules/ir/design/avatar.inc.rst | 11 ++ trytond/doc/modules/ir/design/cache.inc.rst | 7 + .../doc/modules/ir/design/calendar.inc.rst | 23 +++ .../modules/ir/design/configuration.inc.rst | 8 + trytond/doc/modules/ir/design/cron.inc.rst | 15 ++ trytond/doc/modules/ir/design/date.inc.rst | 6 + trytond/doc/modules/ir/design/email.inc.rst | 36 ++++ trytond/doc/modules/ir/design/error.inc.rst | 23 +++ trytond/doc/modules/ir/design/export.inc.rst | 18 ++ trytond/doc/modules/ir/design/index.rst | 34 ++++ trytond/doc/modules/ir/design/lang.inc.rst | 18 ++ trytond/doc/modules/ir/design/message.inc.rst | 16 ++ trytond/doc/modules/ir/design/model.inc.rst | 156 ++++++++++++++++++ trytond/doc/modules/ir/design/module.inc.rst | 58 +++++++ trytond/doc/modules/ir/design/note.inc.rst | 21 +++ trytond/doc/modules/ir/design/queue.inc.rst | 8 + trytond/doc/modules/ir/design/rule.inc.rst | 25 +++ .../doc/modules/ir/design/sequence.inc.rst | 52 ++++++ trytond/doc/modules/ir/design/session.inc.rst | 15 ++ .../doc/modules/ir/design/translation.inc.rst | 49 ++++++ trytond/doc/modules/ir/design/trigger.inc.rst | 16 ++ trytond/doc/modules/ir/design/ui.inc.rst | 131 +++++++++++++++ trytond/doc/modules/ir/index.rst | 15 ++ trytond/doc/modules/ir/reference.rst | 142 ++++++++++++++++ trytond/doc/ref/i18n.rst | 6 +- trytond/doc/ref/index.rst | 1 + trytond/doc/ref/models.rst | 19 ++- trytond/doc/ref/report.rst | 131 +++++++++++++++ trytond/doc/ref/wizard.rst | 7 +- trytond/doc/topics/access_rights.rst | 44 ++--- trytond/doc/topics/cron.rst | 11 +- trytond/doc/topics/modules/index.rst | 2 +- trytond/doc/topics/reports/index.rst | 7 +- trytond/doc/topics/task_queue.rst | 4 +- trytond/doc/topics/translation.rst | 11 +- trytond/doc/topics/triggers.rst | 15 +- trytond/doc/topics/views/extension.rst | 2 +- trytond/doc/topics/views/index.rst | 26 +-- .../doc/tutorial/module/default_values.rst | 4 +- trytond/doc/tutorial/module/extend.rst | 4 +- trytond/doc/tutorial/module/report.rst | 14 +- trytond/doc/tutorial/module/view.rst | 4 +- trytond/doc/tutorial/module/wizard.rst | 13 +- trytond/doc/tutorial/module/workflow.rst | 4 +- 48 files changed, 1250 insertions(+), 90 deletions(-) create mode 100644 trytond/doc/modules/ir/design/action.inc.rst create mode 100644 trytond/doc/modules/ir/design/attachment.inc.rst create mode 100644 trytond/doc/modules/ir/design/avatar.inc.rst create mode 100644 trytond/doc/modules/ir/design/cache.inc.rst create mode 100644 trytond/doc/modules/ir/design/calendar.inc.rst create mode 100644 trytond/doc/modules/ir/design/configuration.inc.rst create mode 100644 trytond/doc/modules/ir/design/cron.inc.rst create mode 100644 trytond/doc/modules/ir/design/date.inc.rst create mode 100644 trytond/doc/modules/ir/design/email.inc.rst create mode 100644 trytond/doc/modules/ir/design/error.inc.rst create mode 100644 trytond/doc/modules/ir/design/export.inc.rst create mode 100644 trytond/doc/modules/ir/design/index.rst create mode 100644 trytond/doc/modules/ir/design/lang.inc.rst create mode 100644 trytond/doc/modules/ir/design/message.inc.rst create mode 100644 trytond/doc/modules/ir/design/model.inc.rst create mode 100644 trytond/doc/modules/ir/design/module.inc.rst create mode 100644 trytond/doc/modules/ir/design/note.inc.rst create mode 100644 trytond/doc/modules/ir/design/queue.inc.rst create mode 100644 trytond/doc/modules/ir/design/rule.inc.rst create mode 100644 trytond/doc/modules/ir/design/sequence.inc.rst create mode 100644 trytond/doc/modules/ir/design/session.inc.rst create mode 100644 trytond/doc/modules/ir/design/translation.inc.rst create mode 100644 trytond/doc/modules/ir/design/trigger.inc.rst create mode 100644 trytond/doc/modules/ir/design/ui.inc.rst create mode 100644 trytond/doc/modules/ir/index.rst create mode 100644 trytond/doc/modules/ir/reference.rst create mode 100644 trytond/doc/ref/report.rst diff --git a/trytond/doc/conf.py b/trytond/doc/conf.py index da4ee1441a..fb17394c50 100644 --- a/trytond/doc/conf.py +++ b/trytond/doc/conf.py @@ -64,6 +64,7 @@ project = info['name'] release = version = info['series'] default_role = 'ref' highlight_language = 'none' +exclude_patterns = ['**/*.inc.rst'] extensions = [ 'sphinx_copybutton', 'sphinx.ext.intersphinx', diff --git a/trytond/doc/modules/index.rst b/trytond/doc/modules/index.rst index 718c271ba4..a226f1825a 100644 --- a/trytond/doc/modules/index.rst +++ b/trytond/doc/modules/index.rst @@ -7,4 +7,5 @@ always activated. .. toctree:: :maxdepth: 2 + ir/index res/index diff --git a/trytond/doc/modules/ir/design/action.inc.rst b/trytond/doc/modules/ir/design/action.inc.rst new file mode 100644 index 0000000000..961c4fd005 --- /dev/null +++ b/trytond/doc/modules/ir/design/action.inc.rst @@ -0,0 +1,87 @@ +.. _model-ir.action: + +Action +====== + +The *Action* concept contains common user interface behavior properties. +The list of keywords specifies where the action is available and for which +`Model `. +If any `Groups ` are added to the action, then only members of +at least one of these groups will have access to the action. + +.. seealso:: + + The Actions can be found by opening the main menu item: + + |Administration --> User Interface --> Actions --> Actions|__ + + .. |Administration --> User Interface --> Actions --> Actions| replace:: :menuselection:`Administration --> User Interface --> Actions --> Actions` + __ https://demo.tryton.org/model/ir.action + +.. _model-ir.action.report: + +Report Action +============= + +The *Report Action* stores the properties needed to execute the named +:class:`~trytond.report.Report`. + +.. seealso:: + + The Report Actions can be found by opening the main menu item: + + |Administration --> User Interface --> Actions --> Reports|__ + + .. |Administration --> User Interface --> Actions --> Reports| replace:: :menuselection:`Administration --> User Interface --> Actions --> Reports` + __ https://demo.tryton.org/model/ir.action.report + +.. _model-ir.action.act_window: + +Window Action +============= + +The *Window Action* stores the properties necessary for the client to open a +tab for a :class:`~trytond.model.ModelStorage`. +It consists of a list of `Views ` and domains. + +.. seealso:: + + The Window Actions can be found by opening the main menu item: + + |Administration --> User Interface --> Actions --> Window Actions|__ + + .. |Administration --> User Interface --> Actions --> Window Actions| replace:: :menuselection:`Administration --> User Interface --> Actions --> Window Actions` + __ https://demo.tryton.org/model/ir.action.act_window + +.. _model-ir.action.wizard: + +Wizard Action +============= + +The *Wizard Action* defines how the client should run the named +:class:`~trytond.wizard.Wizard`. + +.. seealso:: + + The Wizard Actions can be found by opening the main menu item: + + |Administration --> User Interface --> Actions --> Wizards|__ + + .. |Administration --> User Interface --> Actions --> Wizards| replace:: :menuselection:`Administration --> User Interface --> Actions --> Wizards` + __ https://demo.tryton.org/model/ir.action.wizard + +.. _model-ir.action.url: + +URL Action +========== + +Each *URL Action* stores a `URL `_ to open. + +.. seealso:: + + The URL Actions can be found by opening the main menu item: + + |Administration --> User Interface --> Actions --> URLs|__ + + .. |Administration --> User Interface --> Actions --> URLs| replace:: :menuselection:`Administration --> User Interface --> Actions --> URLs` + __ https://demo.tryton.org/model/ir.action.url diff --git a/trytond/doc/modules/ir/design/attachment.inc.rst b/trytond/doc/modules/ir/design/attachment.inc.rst new file mode 100644 index 0000000000..c0a3267339 --- /dev/null +++ b/trytond/doc/modules/ir/design/attachment.inc.rst @@ -0,0 +1,19 @@ +.. _model-ir.attachment: + +Attachment +========== + +*Attachment* is a :class:`~trytond.ir.resource.ResourceMixin` that stores +documents for any :class:`~trytond.model.ModelStorage` record. + +.. seealso:: + + Attachments are found by opening the main menu item: + + |Administration --> Models --> Attachments|__ + + .. |Administration --> Models --> Attachments| replace:: :menuselection:`Administration --> Models --> Attachments` + __ https://demo.tryton.org/model/ir.attachment + + The attachments related to a record are found by opening the + :guilabel:`Attachment` menu item of the toolbar. diff --git a/trytond/doc/modules/ir/design/avatar.inc.rst b/trytond/doc/modules/ir/design/avatar.inc.rst new file mode 100644 index 0000000000..400c4bf268 --- /dev/null +++ b/trytond/doc/modules/ir/design/avatar.inc.rst @@ -0,0 +1,11 @@ +.. _model-ir.avatar: + +Avatar +====== + +*Avatar* is a :class:`~trytond.ir.resource.ResourceMixin` that stores a single +`avatar `_ for any +:meth:`~trytond.model.avatar_mixin` record. +Each *Avatar* record has a :abbr:`UUID (Universally Unique Identifier)` which +is used to construct a URL that returns the picture. +A version of the picture is stored in a cache for each size requested. diff --git a/trytond/doc/modules/ir/design/cache.inc.rst b/trytond/doc/modules/ir/design/cache.inc.rst new file mode 100644 index 0000000000..9f21d9b229 --- /dev/null +++ b/trytond/doc/modules/ir/design/cache.inc.rst @@ -0,0 +1,7 @@ +.. _model-ir.cache: + +Cache +===== + +The *Cache* stores when the named :class:`~trytond.cache.Cache` was last +invalidated. diff --git a/trytond/doc/modules/ir/design/calendar.inc.rst b/trytond/doc/modules/ir/design/calendar.inc.rst new file mode 100644 index 0000000000..289e64e257 --- /dev/null +++ b/trytond/doc/modules/ir/design/calendar.inc.rst @@ -0,0 +1,23 @@ +.. _model-ir.calendar.month: + +Calendar Month +============== + +The *Calendar Month* stores each month of the `Gregorian calendar +`_. + +.. note:: + Its goal is to provide a target for :class:`~trytond.model.fields.Many2One` + fields with localized month names. + +.. _model-ir.calendar.day: + +Calendar Day +============ + +The *Calendar Day* stores each day of the `week +`_. + +.. note:: + Its goal is to provide a target for :class:`~trytond.model.fields.Many2One` + fields with localized week day names. diff --git a/trytond/doc/modules/ir/design/configuration.inc.rst b/trytond/doc/modules/ir/design/configuration.inc.rst new file mode 100644 index 0000000000..0f02031579 --- /dev/null +++ b/trytond/doc/modules/ir/design/configuration.inc.rst @@ -0,0 +1,8 @@ +.. _model-ir.configuration: + +Configuration +============= + +The *Configuration* is a :class:`~trytond.model.ModelSingleton` that stores +configuration from the `database setup `, like the +default language and the host name. diff --git a/trytond/doc/modules/ir/design/cron.inc.rst b/trytond/doc/modules/ir/design/cron.inc.rst new file mode 100644 index 0000000000..bdfd5d2b20 --- /dev/null +++ b/trytond/doc/modules/ir/design/cron.inc.rst @@ -0,0 +1,15 @@ +.. _model-ir.cron: + +Cron +==== + +The *Cron* stores the configuration for `scheduled actions `. + +.. seealso:: + + The Scheduled Actions can be found by opneing the main menu item: + + |Administration --> Scheduler --> Actions|__ + + .. |Administration --> Scheduler --> Actions| replace:: :menuselection:`Administration --> Scheduler --> Actions` + __ https://demo.tryton.org/model/ir.cron diff --git a/trytond/doc/modules/ir/design/date.inc.rst b/trytond/doc/modules/ir/design/date.inc.rst new file mode 100644 index 0000000000..7063be46d4 --- /dev/null +++ b/trytond/doc/modules/ir/design/date.inc.rst @@ -0,0 +1,6 @@ +.. _model-ir.date: + +Date +==== + +The *Date* :class:`~trytond.model.Model` provides the current date. diff --git a/trytond/doc/modules/ir/design/email.inc.rst b/trytond/doc/modules/ir/design/email.inc.rst new file mode 100644 index 0000000000..45b6212867 --- /dev/null +++ b/trytond/doc/modules/ir/design/email.inc.rst @@ -0,0 +1,36 @@ +.. _model-ir.email: + +Email +===== + +The *Email* is a :class:`~trytond.ir.resource.ResourceAccessMixin` that stores +a copy of the emails sent from a :class:`~trytond.model.ModelStorage` record. + +.. seealso:: + + Emails are found by opening the main menu item: + + |Administration --> Models --> E-mails|__ + + .. |Administration --> Models --> E-mails| replace:: :menuselection:`Administration --> Models --> E-mails` + __ https://demo.tryton.org/model/ir.email + + The emails related to a record are found by opening the :guilabel:`E-mails + Archives` menu item from the relate toolbar. + +.. _model-ir.email.template: + +Email Template +============== + +The *Email Template* stores templates per `Model ` and is used +to fill in the client's E-mail form. + +.. seealso:: + + Email Templates are found by opening the main menu item: + + |Administration --> User Interface --> Actions --> E-mail Templates|__ + + .. |Administration --> User Interface --> Actions --> E-mail Templates| replace:: :menuselection:`Administration --> User Interface --> Actions --> E-mail Templates` + __ https://demo.tryton.org/model/ir.email.template diff --git a/trytond/doc/modules/ir/design/error.inc.rst b/trytond/doc/modules/ir/design/error.inc.rst new file mode 100644 index 0000000000..202a387313 --- /dev/null +++ b/trytond/doc/modules/ir/design/error.inc.rst @@ -0,0 +1,23 @@ +.. _model-ir.error: + +Error +===== + +The *Error* stores exceptions raised by non interactive processes. +An *Error* can be processed and then solved by a `User `. +When an *Error* is solved the process that originally reported the error is run +again. + +.. note:: + + A `scheduled task ` deletes the errors after the configured + `number of days `. + +.. seealso:: + + The Errors can be found by opening the main menu item: + + |Administration --> Scheduler --> Errors|__ + + .. |Administration --> Scheduler --> Errors| replace:: :menuselection:`Administration --> Scheduler --> Errors` + __ https://demo.tryton.org/model/ir.error diff --git a/trytond/doc/modules/ir/design/export.inc.rst b/trytond/doc/modules/ir/design/export.inc.rst new file mode 100644 index 0000000000..ee4da73c2e --- /dev/null +++ b/trytond/doc/modules/ir/design/export.inc.rst @@ -0,0 +1,18 @@ +.. _model-ir.export: + +Export +====== + +The *Export* stores the saved exports for each `User `. +An export is composed of a list of :class:`~trytond.model.fields.Field` names. +When an *Export* is associated with a `Group `, it becomes +available for all the *Users* of that *Group*. + +.. seealso:: + + The exports can be found by opening the main menu item: + + |Administration --> Models --> Exports|__ + + .. |Administration --> Models --> Exports| replace:: :menuselection:`Administration --> Models --> Exports` + __ https://demo.tryton.org/model/ir.export diff --git a/trytond/doc/modules/ir/design/index.rst b/trytond/doc/modules/ir/design/index.rst new file mode 100644 index 0000000000..2fa0de69d3 --- /dev/null +++ b/trytond/doc/modules/ir/design/index.rst @@ -0,0 +1,34 @@ +****** +Design +****** + +The *Internal Resource Module* introduces the following concepts: + +.. note:: + + For historical reasons the module's technical name is ``ir``. + +.. include:: model.inc.rst +.. include:: action.inc.rst +.. include:: module.inc.rst + +.. include:: attachment.inc.rst +.. include:: avatar.inc.rst +.. include:: cache.inc.rst +.. include:: calendar.inc.rst +.. include:: configuration.inc.rst +.. include:: cron.inc.rst +.. include:: date.inc.rst +.. include:: email.inc.rst +.. include:: error.inc.rst +.. include:: export.inc.rst +.. include:: lang.inc.rst +.. include:: message.inc.rst +.. include:: note.inc.rst +.. include:: queue.inc.rst +.. include:: rule.inc.rst +.. include:: sequence.inc.rst +.. include:: session.inc.rst +.. include:: translation.inc.rst +.. include:: trigger.inc.rst +.. include:: ui.inc.rst diff --git a/trytond/doc/modules/ir/design/lang.inc.rst b/trytond/doc/modules/ir/design/lang.inc.rst new file mode 100644 index 0000000000..09c6205f57 --- /dev/null +++ b/trytond/doc/modules/ir/design/lang.inc.rst @@ -0,0 +1,18 @@ +.. _model-ir.lang: + +Language +======== + +The *Language* defines the properties such as the direction and the formatting +of the supported languages. +By loading the translations for a *Language*, it becomes translatable and can +be used to translate the user interface. + +.. seealso:: + + The Languages can be found by opening the main menu item: + + |Administration --> Localization --> Languages|__ + + .. |Administration --> Localization --> Languages| replace:: :menuselection:`Administration --> Localization --> Languages` + __ https://demo.tryton.org/model/ir.lang diff --git a/trytond/doc/modules/ir/design/message.inc.rst b/trytond/doc/modules/ir/design/message.inc.rst new file mode 100644 index 0000000000..e0acf36651 --- /dev/null +++ b/trytond/doc/modules/ir/design/message.inc.rst @@ -0,0 +1,16 @@ +.. _model-ir.message: + +Message +======= + +The *Message* stores translatable text that is shown to the `Users +`. + +.. seealso:: + + The Messages can be found by opening the main menu item: + + |Administration --> Localization --> Messages|__ + + .. |Administration --> Localization --> Messages| replace:: :menuselection:`Administration --> Localization --> Messages` + __ https://demo.tryton.org/model/ir.message diff --git a/trytond/doc/modules/ir/design/model.inc.rst b/trytond/doc/modules/ir/design/model.inc.rst new file mode 100644 index 0000000000..600406e721 --- /dev/null +++ b/trytond/doc/modules/ir/design/model.inc.rst @@ -0,0 +1,156 @@ +.. _model-ir.model: + +Model +===== + +The *Model* stores a record of each subclass of :class:`~trytond.model.Model` +that is registered in the :class:`~trytond.pool.Pool`. + +A model is composed of `Fields ` that represents each +:class:`~trytond.model.fields.Field` it contains. + +The administrator can enable global search for records of the model by checking +the :guilabel:`Global Search` box. + +.. seealso:: + + Models are found by opening the main menu item: + + |Administration --> Models --> Models|__ + + .. |Administration --> Models --> Models| replace:: :menuselection:`Administration --> Models --> Models` + __ https://demo.tryton.org/model/ir.model + +Reports +------- + +.. _report-ir.model.workflow_graph: + +Workflow Graph +-------------- + +The *Workflow Graph* prints a `state diagram +`_ for each selected +:class:`~trytond.model.Workflow` *Model*. + +Wizards +------- + +.. _wizard-ir.model.print_model_graph: + +Graph +^^^^^ + +The *Graph* wizard prints an `object diagram +`_ that shows the relationships +between the selected *Models* down to the specified depth. + +.. _model-ir.model.field: + +Model Field +=========== + +The *Model Field* keeps a record for each subclass of +:class:`~trytond.model.fields.Field` that a `Model ` contains. + +.. seealso:: + + Model Fields are found by opening the main menu item: + + |Administration --> Models --> Models --> Fields|__ + + .. |Administration --> Models --> Models --> Fields| replace:: :menuselection:`Administration --> Models --> Models --> Fields` + __ https://demo.tryton.org/model/ir.model.field + +.. _model-ir.model.access: + +Model Access +============ + +The *Model Access* defines the `access rights ` to +`Models ` for each `Group `. + +.. seealso:: + + Models Access are found by opening the main menu item: + + |Administration --> Models --> Models Access|__ + + .. |Administration --> Models --> Models Access| replace:: :menuselection:`Administration --> Models --> Models Access` + __ https://demo.tryton.org/model/ir.model.access + +.. _model-ir.model.field.access: + +Model Field Access +=================== + +The *Model Field Access* defines the `access rights ` to +`Model Fields ` for each `group `. + +.. seealso:: + + Model Fields Access are found by opening the main menu item: + + |Administration --> Models --> Models Access --> Fields Access|__ + + .. |Administration --> Models --> Models Access --> Fields Access| replace:: :menuselection:`Administration --> Models --> Models Access --> Fields Access` + __ https://demo.tryton.org/model/ir.model.field.access + +.. _model-ir.model.button: + +Model Button +============ + +The *Model Button* stores the buttons defined in the `Models `. +It also contains a list of `Groups ` that have `access +` to the button and a list of rules that must be +satisfied to trigger the button's action. + +.. seealso:: + + Model Buttons are found by opening the main menu item: + + |Administration --> Models --> Models Access --> Buttons|__ + + .. |Administration --> Models --> Models Access --> Buttons| replace:: :menuselection:`Administration --> Models --> Models Access --> Buttons` + __ https://demo.tryton.org/model/ir.model.button + +.. _model-ir.model.data: + +Model Data +========== + +The *Model Data* keeps track of the :class:`~trytond.model.ModelStorage` +records created by modules via `XML files `. +If a *Model Data* is out of sync (i.e. the values in the database do not match +the values in the XML definition), it is possible to force synchronisation +using the :guilabel:`Sync` button. + +.. seealso:: + + Model Data are found by opening the main menu item: + + |Administration --> Models --> Data|__ + + .. |Administration --> Models --> Data| replace:: :menuselection:`Administration --> Models --> Data` + __ https://demo.tryton.org/model/ir.model.data + +.. _model-ir.model.log: + +Model Log +========= + +The *Model Log* records events such as modification, suppression, click, launch +and transition that happened to a :class:`~trytond.model.ModelStorage` record. + +.. seealso:: + + Model Logs are found by opening the main menu item: + + |Administration --> Models --> Models --> Logs|__ + + .. |Administration --> Models --> Models --> Logs| replace:: :menuselection:`Administration --> Models --> Models --> Logs` + __ https://demo.tryton.org/model/ir.model.log + + The logs related to a record are found by opening the :guilabel:`View + Logs...` menu item of the toolbar. diff --git a/trytond/doc/modules/ir/design/module.inc.rst b/trytond/doc/modules/ir/design/module.inc.rst new file mode 100644 index 0000000000..0dfb421bce --- /dev/null +++ b/trytond/doc/modules/ir/design/module.inc.rst @@ -0,0 +1,58 @@ +.. _model-ir.module: + +Module +====== + +Every Tryton `Module ` has one entry. +The *Module* keeps track of whether it is activated or not. + +.. seealso:: + + Modules are found by opening the main menu item: + + |Administration --> Modules --> Modules|__ + + .. |Administration --> Modules --> Modules| replace:: :menuselection:`Administration --> Modules --> Modules` + __ https://demo.tryton.org/model/ir.module + +Wizards +------- + +.. _wizard-ir.module.activate_upgrade: + +Activate / Upgrade Module +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The *Activate / Upgrade Module* wizard performs the activation or upgrade of +the `Modules ` marked as "To Upgrade", "To Remove" and "To +Activate". +It then launches the `Config Module ` wizard. + +.. _model-ir.module.config_wizard.item: + +Module Config Wizard Item +========================= + +The *Module Config Wizard Item* keeps track of the configuration `Actions +` to be launched after the `Activate / Upgrade Module +` wizard. + +.. seealso:: + + Module Config Wizard Items are found by opening the main menu item: + + |Administration --> Modules --> Config Wizard Items|__ + + .. |Administration --> Modules --> Config Wizard Items| replace:: :menuselection:`Administration --> Modules --> Config Wizard Items` + __ https://demo.tryton.org/model/ir.module.config_wizard.item + +Wizards +------- + +.. _wizard-ir.module.config_wizard: + +Config Modules +^^^^^^^^^^^^^^ + +The *Config Modules* wizard launches all the pending `Items +` sequentially. diff --git a/trytond/doc/modules/ir/design/note.inc.rst b/trytond/doc/modules/ir/design/note.inc.rst new file mode 100644 index 0000000000..03582ae7dd --- /dev/null +++ b/trytond/doc/modules/ir/design/note.inc.rst @@ -0,0 +1,21 @@ +.. _model-ir.note: + +Note +==== + +*Note* is a :class:`~trytond.ir.resource.ResourceMixin` that stores `User +`'s messages associated with any +:class:`~trytond.model.ModelStorage` record. +The *Note* keeps track of who has read each message. + +.. seealso:: + + Notes are found by opening the main menu item: + + |Administration --> Models --> Notes|__ + + .. |Administration --> Models --> Notes| replace:: :menuselection:`Administration --> Models --> Notes` + __ https://demo.tryton.org/model/ir.note + + The notes related to a record are found by opening the :guilabel:`Note` menu + item of the toolbar. diff --git a/trytond/doc/modules/ir/design/queue.inc.rst b/trytond/doc/modules/ir/design/queue.inc.rst new file mode 100644 index 0000000000..e28fea0bb6 --- /dev/null +++ b/trytond/doc/modules/ir/design/queue.inc.rst @@ -0,0 +1,8 @@ +.. _model-ir.queue: + +Queue +===== + +The *Queue* stores the `tasks ` to be run asynchronously. +An expected :py:class:`~datetime.datetime` can be set to define when the task +should be run. diff --git a/trytond/doc/modules/ir/design/rule.inc.rst b/trytond/doc/modules/ir/design/rule.inc.rst new file mode 100644 index 0000000000..078f894cfc --- /dev/null +++ b/trytond/doc/modules/ir/design/rule.inc.rst @@ -0,0 +1,25 @@ +.. _model-ir.rule.group: + +Rule Group +========== + +The *Rule Group* stores a set of `Rules ` that define the +`access rights ` for records of a `Model +`. + +.. seealso:: + + The Rule Group can be found by opening the main menu item: + + |Administration --> Models --> Record Rules|__ + + .. |Administration --> Models --> Record Rules| replace:: :menuselection:`Administration --> Models --> Record Rules` + __ https://demo.tryton.org/model/ir.rule.group + +.. _model-ir.rule: + +Rule +==== + +The *Rule* defines a `Domain ` for a `Rule Group +`. diff --git a/trytond/doc/modules/ir/design/sequence.inc.rst b/trytond/doc/modules/ir/design/sequence.inc.rst new file mode 100644 index 0000000000..f8c700b231 --- /dev/null +++ b/trytond/doc/modules/ir/design/sequence.inc.rst @@ -0,0 +1,52 @@ +.. _model-ir.sequence: + +Sequence +======== + +The *Sequence* defines the properties to generate unique and sequential strings +with numbers. +A prefix and suffix can be added to the generated sequence string. +These support formatting that can include the current `Date `. + +.. seealso:: + + The Sequences can be found by opening the main menu item: + + |Administration --> Sequences --> Sequences|__ + + .. |Administration --> Sequences --> Sequences| replace:: :menuselection:`Administration --> Sequences --> Sequences` + __ https://demo.tryton.org/model/ir.sequence + +.. _model.ir.sequence.strict: + +Sequence Strict +=============== + +The *Sequence Strict* is similar to the `Sequence ` but it +prevents any gaps in the generated numbers. + +.. seealso:: + + The Sequences Strict can be found by opening the main menu item: + + |Administration --> Sequences --> Sequences Strict|__ + + .. |Administration --> Sequences --> Sequences Strict| replace:: :menuselection:`Administration --> Sequences --> Sequences Strict` + __ https://demo.tryton.org/model/ir.sequence.strict + +.. _model-ir.sequence.type: + +Sequence Type +============= + +The *Sequence Type* is used to categorize the `Sequences ` +and defines the `Groups ` allowed to edit them. + +.. seealso:: + + The Sequence Types can be found by opening the main menu item: + + |Administration --> Sequences --> Types|__ + + .. |Administration --> Sequences --> Types| replace:: :menuselection:`Administration --> Sequences --> Types` + __ https://demo.tryton.org/model/ir.sequence.type diff --git a/trytond/doc/modules/ir/design/session.inc.rst b/trytond/doc/modules/ir/design/session.inc.rst new file mode 100644 index 0000000000..3ec6945b20 --- /dev/null +++ b/trytond/doc/modules/ir/design/session.inc.rst @@ -0,0 +1,15 @@ +.. _model-ir.session: + +Session +======= + +The *Session* generates and stores the session keys for connected `Users +`. + +.. _model-ir.session.wizard: + +Session Wizard +============== + +The *Session Wizard* stores the data from active :class:`~trytond.wizard.State` +of the :class:`~trytond.wizard.Wizard`. diff --git a/trytond/doc/modules/ir/design/translation.inc.rst b/trytond/doc/modules/ir/design/translation.inc.rst new file mode 100644 index 0000000000..fde1c6c18c --- /dev/null +++ b/trytond/doc/modules/ir/design/translation.inc.rst @@ -0,0 +1,49 @@ +.. _model-ir.translation: + +Translation +=========== + +The *Translation* stores the translated strings for each `Language +`. + +Wizards +------- + +.. _wizard-ir.translation.set: + +Set Translation +^^^^^^^^^^^^^^^ + +The *Set Translation* wizard creates missing entries for the ``en`` language +for the activated modules. + +.. _wizard-ir.translation.clean: + +Clean Translation +^^^^^^^^^^^^^^^^^ + +The *Clean Translation* wizard deletes obsolete entries. + +.. _wizard-ir.translation.update: + +Update Translation +^^^^^^^^^^^^^^^^^^ + +The *Update Translation* wizard creates missing entries for other languages +based on the ``en`` entries. + +.. _wizard-ir.translation.export: + +Export Translation +^^^^^^^^^^^^^^^^^^ + +The *Export Translation* wizard generates a PO-file for the selected module and +language. + +.. _wizard-ir.translation.report: + +Open Report Translation +^^^^^^^^^^^^^^^^^^^^^^^ + +The *Open Report Translation* wizard opens the list of translations for the +`Reports `. diff --git a/trytond/doc/modules/ir/design/trigger.inc.rst b/trytond/doc/modules/ir/design/trigger.inc.rst new file mode 100644 index 0000000000..b959a647df --- /dev/null +++ b/trytond/doc/modules/ir/design/trigger.inc.rst @@ -0,0 +1,16 @@ +.. _model-ir.trigger: + +Trigger +======= + +The *Trigger* registers the `conditions and the action ` to +execute when a :class:`~trytond.model.Model` record is modified. + +.. seealso:: + + The Triggers can be found by opening the main menu item: + + |Administration --> Models --> Triggers|__ + + .. |Administration --> Models --> Triggers| replace:: :menuselection:`Administration --> Models --> Triggers` + __ https://demo.tryton.org/model/ir.trigger diff --git a/trytond/doc/modules/ir/design/ui.inc.rst b/trytond/doc/modules/ir/design/ui.inc.rst new file mode 100644 index 0000000000..bb56e2d02c --- /dev/null +++ b/trytond/doc/modules/ir/design/ui.inc.rst @@ -0,0 +1,131 @@ +.. _model-ir.ui.menu: + +UI Menu +======= + +The *Menu* defines the tree structure for the client menu. +Each entry may be linked to one or more `Actions ` via the +``tree_open`` keyword. +Also, each `User ` can add menu records to their favorites. + +.. seealso:: + + The Menu entries can be found by opening the main menu item: + + |Administration --> User Interface --> Menu|__ + + .. |Administration --> User Interface --> Menu| replace:: :menuselection:`Administration --> User Interface --> Menu` + __ https://demo.tryton.org/model/ir.ui.menu + +.. _model-ir.ui.view: + +UI View +======= + +The *View* stores the definitions of the different types of view for each +:class:`~trytond.model.Model`. +A *View* can inherit from another *View* to extend its content. + +.. seealso:: + + The Views can be found by opening the main menu item: + + |Administration --< User Interface --> Views|__ + + .. |Administration --< User Interface --> Views| replace:: :menuselection:`Administration --< User Interface --> Views` + __ https://demo.tryton.org/model/ir.ui.view + +Wizards +------- + +.. _wizard-ir.ui.view.show: + +Show View +^^^^^^^^^ + +The *Show View* wizard renders the form `View `. + +.. _model-ir.ui.view_tree_width: + +UI View Tree Width +================== + +The *View Tree Width* stores the `User `'s desired column +widths for each `Field ` of the `Model `. + +.. seealso:: + + The View Tree Widths can be found by opening the main menu item: + + |Administration --> User Interface --> View Tree Width|__ + + .. |Administration --> User Interface --> View Tree Width| replace:: :menuselection:`Administration --> User Interface --> View Tree Width` + __ https://demo.tryton.org/model/ir.ui.view_tree_width + +.. _model-ir.ui.view_tree_optional: + +UI View Tree Optional +===================== + +The *View Tree Optional* stores whether a `User ` wants an +optional field to be displayed or not for a `View `. + +.. seealso:: + + The View Tree Optionals can be found by opening the main menu item: + + |Administration --> User Interface --> View Tree Optional|__ + + .. |Administration --> User Interface --> View Tree Optional| replace:: :menuselection:`Administration --> User Interface --> View Tree Optional` + __ https://demo.tryton.org/model/ir.ui.view_tree_optional + +.. _model-ir.ui.view_tree_state: + +UI View Tree State +================== + +The *View Tree State* stores, for each `User `, the tree view's +expanded and selected nodes for a `Model `, `Domain +` and children. + +.. seealso:: + + The View Tree States can be found by opening the main menu item: + + |Administration --> User Interface --> Tree State|__ + + .. |Administration --> User Interface --> Tree State| replace:: :menuselection:`Administration --> User Interface --> Tree State` + __ https://demo.tryton.org/model/ir.ui.view_tree_state + +.. _model-ir.ui.view_search: + +UI View Search +============== + +The *View Search* stores the `User's ` saved `Domain +` for a `Model `. + +.. seealso:: + + The View Searches can be found by opening the main menu item: + + |Administration --> User Interface --> View Search|__ + + .. |Administration --> User Interface --> View Search| replace:: :menuselection:`Administration --> User Interface --> View Search` + __ https://demo.tryton.org/model/ir.ui.view_search + +.. _model-ir.ui.icon: + +UI Icon +======= + +The *Icon* defines the path where a named icon is stored. + +.. seealso:: + + The Icons can be found by opening the main menu item: + + |Administration --> User Interface --> Icons|__ + + .. |Administration --> User Interface --> Icons| replace:: :menuselection:`Administration --> User Interface --> Icons` + __ https://demo.tryton.org/model/ir.ui.icon diff --git a/trytond/doc/modules/ir/index.rst b/trytond/doc/modules/ir/index.rst new file mode 100644 index 0000000000..e7cd8e096a --- /dev/null +++ b/trytond/doc/modules/ir/index.rst @@ -0,0 +1,15 @@ +.. _ir: + +######################## +Internal Resource Module +######################## + +The *Internal Resource Module* provides the basic internal resources needed to +run Tryton. +This includes the models, actions and user interface definitions. + +.. toctree:: + :maxdepth: 2 + + design/index + reference diff --git a/trytond/doc/modules/ir/reference.rst b/trytond/doc/modules/ir/reference.rst new file mode 100644 index 0000000000..8072fe54fc --- /dev/null +++ b/trytond/doc/modules/ir/reference.rst @@ -0,0 +1,142 @@ +************* +API Reference +************* + +Resources +========= + +.. module:: trytond.ir.resource + +.. class:: ResourceAccessMixin + + This mixin_ adds a ``resource`` :class:`~trytond.model.fields.Reference` + field and applies the same access right as the resource to the + :class:`~trytond.model.ModelStorage`. + +.. class:: ResourceMixin + + This mixin_ extends the :class:`ResourceAccessMixin` to add some metadata + fields and the option to copy the record using :meth:`resource_copy`. + +.. method:: resource_copy(resource, name, string) + + Returns a mixin_ that adds the named :class:`~trytond.model.fields.One2Many` + to the ``resource`` :class:`~trytond.model.ModelStorage`. + The mixin also adds a ``copy_resources_to(target)`` instance method that + copies the resource records to the ``target``. + +Attachments +=========== + +.. module:: trytond.ir.attachment + +.. class:: AttachmentCopyMixin + + A mixin_ setup by the :meth:`~trytond.ir.resource.resource_copy` for the + `Attachments `. + +Notes +===== + +.. module:: trytond.ir.note + +.. class:: NoteCopyMixin + + A mixin_ setup by the :meth:`~trytond.ir.resource.resource_copy` for the + `Notes `. + +Language +======== + +.. module:: trytond.ir.lang + +.. class:: Language + +.. method:: Language.get([code]) + + Returns the language instance for the ``code`` or the + :attr:`~trytond.transaction.Transaction.language`. + +.. method:: Language.format(percent, value[, grouping[, monetary[, \*\*additional]]]) + + Formats the ``value`` according to the language by substitution of the + ``%?`` specifier. + +.. method:: Language.currency(val, currency[, symbol[, grouping[, digits]]]) + + Formats the numeric ``value`` according to the language and the currency. + +.. method:: Language.strftime(value[, format]) + + Formats the :py:class:`~datetime.date` or :py:class:`~datetime.datetime` + according to the language. + +.. method:: Language.format_number(value[, digits[, grouping[, monetary]]]) + + Formats the number ``value`` according to the language. + +.. method:: Language.format_number_symbol(value, symbol[, digits[, grouping]]) + + Formats the number ``value`` with the :class:`~trytond.model.SymbolMixin` + instance according to the language. + +.. _HTML Editor: + +HTML Editor +=========== + +A route is registered to allow HTML :class:`~trytond.model.fields.Text` fields +to be edited using a web editor: + + - ``GET`` ``//ir/html///`` + Returns the web page containing the editor with: + + ``model`` is the name of the :class:`~trytond.model.ModelStorage`. + ``record`` is the :class:`~trytond.model.Model.id` of the record. + ``field`` is the name of the :class:`~trytond.model.fields.Text` field. + + - ``POST`` ``//ir/html///`` + Save the ``text`` value in the form with: + + ``model`` is the name of the :class:`~trytond.model.ModelStorage`. + ``record`` is the :class:`~trytond.model.Model.id` of the record. + ``field`` is the name of the :class:`~trytond.model.fields.Text` field. + + +.. _Download CSV Data: + +Download CSV Data +================= + +A route is registered to download records as a CSV file: + + - ``GET`` ``//data/`` + Returns a CSV file for the records of ``model`` using the parameters: + + ``l`` is the language. + ``d`` is a JSON encoded domain. + ``c`` is a JSON encoded context. + ``s`` is an integer to limit the number of records. + ``p`` is the offset to apply to the list of records. + ``o`` is a list of fields and orders separated by ``,``. + ``f`` is a list of field names. + ``enc`` is the encoding with ``UTF-8`` as default. + ``dl`` is the CSV delimiter. + ``qc`` is the quoting char. + ``h`` is a boolean integer whether to include the header or not. + ``loc`` is a boolean integer whether to use locale format or not. + +.. _Fetch Avatar: + +Fetch Avatar +============ + +A route is registered from which an `Avatar ` can be downloaded: + + - ``GET`` ``/avatar//`` + Returns the avatar using ``s`` parameter for the size and with: + + ``database_name`` is the name of the database encoded in base64. + ``uuid`` is the UUID of the avatar. + +.. _mixin: https://en.wikipedia.org/wiki/Mixin diff --git a/trytond/doc/ref/i18n.rst b/trytond/doc/ref/i18n.rst index 5c06bc9518..e5f6a7c723 100644 --- a/trytond/doc/ref/i18n.rst +++ b/trytond/doc/ref/i18n.rst @@ -8,9 +8,9 @@ Internationalization Return the message translated into the ``language``. - The ``message_id`` is the ``XML`` id for the ``ir.message`` that is to be - translated, and the ``variables`` keyword arguments are used as a mapping to - format the string. + The ``message_id`` is the ``XML`` id for the `Message ` + that is to be translated, and the ``variables`` keyword arguments are used + as a mapping to format the string. If ``language`` is not set, then the :attr:`Transaction.language ` is used. diff --git a/trytond/doc/ref/index.rst b/trytond/doc/ref/index.rst index 7fe4c37491..10a76f6500 100644 --- a/trytond/doc/ref/index.rst +++ b/trytond/doc/ref/index.rst @@ -12,6 +12,7 @@ Reference of the ``trytond`` API: models fields wizard + report pyson transaction exceptions diff --git a/trytond/doc/ref/models.rst b/trytond/doc/ref/models.rst index 1859fd2173..c5d17e1dc2 100644 --- a/trytond/doc/ref/models.rst +++ b/trytond/doc/ref/models.rst @@ -76,7 +76,8 @@ Class methods: .. classmethod:: Model.__register__(module_name) - Register the model in ``ir.model`` and ``ir.model.field``. + Register the model in `Model ` and `Model Field + `. See :meth:`trytond.pool.PoolBase.__register__`. .. classmethod:: Model.default_get(fields_names[, with_rec_name]) @@ -338,8 +339,8 @@ Class methods: .. classmethod:: ModelStorage.trigger_create(records) Trigger create actions. - It calls actions defined in ``ir.trigger`` with ``on_create`` set and - ``condition`` is true. + It calls actions defined in the `Trigger ` where + ``on_create`` is set and the ``condition`` is true. .. classmethod:: ModelStorage.read(ids, fields_names) @@ -385,8 +386,9 @@ Class methods: .. classmethod:: ModelStorage.trigger_write(eligibles) Trigger write actions. - It will call actions defined in ``ir.trigger`` with ``on_write`` set and - ``condition`` was false before :meth:`~ModelStorage.write` and true after. + It calls actions defined in `Trigger ` where ``on_write`` + is set and the ``condition`` was false before :meth:`~ModelStorage.write` + and true after. .. classmethod:: ModelStorage.index_set_field(name) @@ -399,8 +401,8 @@ Class methods: .. classmethod:: ModelStorage.trigger_delete(records) Trigger delete actions. - It will call actions defined in ``ir.trigger`` with ``on_delete`` set and - ``condition`` is true. + It calls actions defined in `Trigger ` where ``on_delete`` + is set and ``condition`` is true. .. classmethod:: ModelStorage.copy(records[, default]) @@ -1198,7 +1200,8 @@ avatar, if it's not set then no default avatar is generated. .. attribute:: AvatarMixin.avatars - The :class:`~fields.One2Many` field used to store the ``ir.avatar`` records. + The :class:`~fields.One2Many` field used to store the `Avatar + ` records. .. attribute:: AvatarMixin.avatar diff --git a/trytond/doc/ref/report.rst b/trytond/doc/ref/report.rst new file mode 100644 index 0000000000..4b06b1cbf5 --- /dev/null +++ b/trytond/doc/ref/report.rst @@ -0,0 +1,131 @@ +.. _ref-report: +.. module:: trytond.report + +Report +====== + +A report generates printable documents from +:class:`~trytond.model.ModelStorage` records. + +There is also a more :ref:`practical introduction into reports +`. + +.. class:: Report() + + This is the base class for all reports. + +Class attributes are: + +.. attribute:: Report.__name__ + + The unique name used to reference the report throughout the platform. + +Class methods are: + +.. classmethod:: Report.__setup__() + + Setup the class before adding it to the :class:`~trytond.pool.Pool`. + +.. classmethod:: Report.__post_setup__() + + Setup the class after adding it to the :class:`~trytond.pool.Pool`. + +.. classmethod:: Report.__register__(module_name) + + Registers the report. + +.. classmethod:: Report.check_access() + + Verifies if the :attr:`~trytond.transaction.Transaction.user` is allowed to + execute the report. + +.. classmethod:: Report.header_key(record) + + Returns a tuple of keys, composed of couples of name and record value, used + to group document with the same header. + +.. classmethod:: Report.execute(ids, data) + + Executes the report for the :class:`~trytond.model.ModelStorage` instances + with the ``ids`` and returns a tuple containing the report type, the content, + a boolean to indicate direct printing and the report name. + ``data`` is a dictionary that will be available in the evaluation context of + the report. + +.. classmethod:: Report.get_context(records, header, data) + + Returns a dictionary with the evaluation context of the report template. + The context is filled by default with the keys: + + - ``header`` + - ``data`` + - :attr:`~trytond.transaction.Transaction.context` + - :attr:`~trytond.transaction.Transaction.user` + - ``records`` + - ``record`` (containing the first ``records``) + - :meth:`~Report.format_date` + - :meth:`~Report.format_datetime` + - :meth:`~Report.format_timedelta` + - :meth:`~Report.format_currency` + - :meth:`~Report.format_number` + - :meth:`~Report.format_number_symbol` + - :py:mod:`datetime` + - :meth:`~Report.barcode` + - :meth:`~Report.qrcode` + - ``set_lang`` + +.. classmethod:: Report.render(report, report_context) + + Returns the content of the `Report ` rendered by the + templating engine. + +.. classmethod:: Report.convert(report, data, [timeout[, retry]]) + + Converts the report content ``data`` into the format defined by the `Report + `. + +.. classmethod:: Report.format_date(value[, lang[, format]]) + + Returns the formatted :py:class:`~datetime.date`. + +.. classmethod:: Report.format_datetime(value[, lang[, format[, timezone]]]) + + Returns the formatted :py:class:`~datetime.datetime`. + +.. classmethod:: Report.format_timedelta(value[, converter[, lang]]) + + Returns the formatted :py:class:`~datetime.timedelta`. + +.. classmethod:: Report.format_currency(value, lang, currency[, symbol[, grouping[, digits]]]) + + Returns the formatted numeric value. + +.. classmethod:: Report.format_number(value, lang[, digits[, grouping[, monetary]]]) + + Returns the formatted numeric value. + +.. classmethod:: Report.format_number_symbol(value, lang, symbol[, digits[, grouping[, monetary]]]) + + Returns the numeric value formatted using the + :class:`~trytond.model.SymbolMixin` instance. + +.. classmethod:: Report.barcode(name, code[, size[, \*\*kwargs]]) + + Returns named barcode image for the ``code``, the mimetype and the size. + The optional keyword arguments are the same as + :func:`~trytond.tools.barcode.generate_svg`. + +.. classmethod:: Report.qrcode(code[, size[, \*\*kwargs]]) + + Returns the QRCode image for the ``code``, the mimetype and the size. + The optional keyword arguments are the sames as + :func:`~trytond.tools.qrcode.generate_svg`. + +Email +===== + +.. function:: get_email(report, record, languages) + + Returns the :py:class:`~email.message.EmailMessage` and title using the + `Report ` rendered for the + :class:`~trytond.model.ModelStorage` record for each language. diff --git a/trytond/doc/ref/wizard.rst b/trytond/doc/ref/wizard.rst index fc0fb090cf..5bfd45ec18 100644 --- a/trytond/doc/ref/wizard.rst +++ b/trytond/doc/ref/wizard.rst @@ -195,7 +195,8 @@ StateAction .. class:: StateAction(action_id) - A :class:`StateTransition` which let the client launch an ``ir.action``. + A :class:`StateTransition` which lets the client launch an `Action + `. This action definition can be customized with a method on wizard having the same name as the state but starting with ``do_``. @@ -204,13 +205,13 @@ Instance attributes are: .. attribute:: StateAction.action_id - The XML id of the ``ir.action``. + The XML id of the `Action `. Instance methods are: .. method:: StateAction.get_action() - Return the ``ir.action`` definition. + Return the `Action ` definition. StateReport diff --git a/trytond/doc/topics/access_rights.rst b/trytond/doc/topics/access_rights.rst index 75fd52a37c..a6eb66e1f4 100644 --- a/trytond/doc/topics/access_rights.rst +++ b/trytond/doc/topics/access_rights.rst @@ -17,11 +17,12 @@ The access rights are checked if the :attr:`Transaction.context Model ===== -They are defined by records of ``ir.model.access`` which define for each couple -of model and group, the ``read``, ``write``, ``create`` and ``delete`` -permission. The permissions are related to the -:class:`~trytond.model.ModelStorage` methods with the same name and on -:meth:`~trytond.model.ModelStorage.search` using the ``read`` permission. +They are defined by records of `Model Access ` which +define for each combined model and group, the ``read``, ``write``, ``create`` +and ``delete`` permissions. +The permissions are related to the :class:`~trytond.model.ModelStorage` methods +with the same name and on :meth:`~trytond.model.ModelStorage.search` using the +``read`` permission. If any group the user belongs to has the checked permission activated, then the user is granted this permission. @@ -35,8 +36,8 @@ If there is no record for the model, then access is granted to all users. Actions ======= -Each ``ir.action`` has a ``groups`` field which contains a list of user groups -that are allowed to see and launch it. +Each `Action ` has a ``groups`` field which contains a list of +user groups that are allowed to see and launch it. There is a special case for :ref:`wizard ` for which the read access on the model is also checked and also the write access if there is no @@ -45,8 +46,9 @@ groups linked. Field ===== -They are defined by records of ``ir.model.field.access`` and work like those -for `Model`_ but are applied to :ref:`fields `. +They are defined by records of `Model Field Access +` and work like those for `Model`_ but are applied +to :ref:`fields `. .. note:: Fields for which the user has no read access are automatically removed from @@ -55,9 +57,10 @@ for `Model`_ but are applied to :ref:`fields `. Button ====== -For each button of a model the records of ``ir.model.button`` define the list of -groups that are allowed to call it. The user only needs to belong to one of the -groups to be granted the permission to use it. +For each button of a model the records of `Model Button +` define the list of groups that are allowed to call it. +The user only needs to belong to one of the groups to be granted the permission +to use it. If no group is defined for a button, the ``write`` permission to the model is checked instead. @@ -70,17 +73,19 @@ The ``read`` permission to the model is always enforced. Button Rule ----------- -The ``ir.model.button`` can contain a list of rules which define how many -different users must click on the button. Each rule, for which the condition -is met, must be passed to actually trigger the action. The counter can be reset -when another defined button is clicked. +The `Model Button ` can contain a list of rules which +define how many different users must click on the button. +Each rule, for which the condition is met, must be passed to actually trigger +the action. +The counter can be reset when another defined button is clicked. Record Rule =========== The record rules are conditions that records must meet for the user to be granted permission to use them. -They are defined by records of ``ir.rule.group`` which contains: +They are defined by records of `Rule Group ` which +contains: - The model the rule applies to. - The type of permissions to be granted. @@ -90,8 +95,9 @@ They are defined by records of ``ir.rule.group`` which contains: - A default flag to apply the rule, by default, to all users. This then allows other less restrictive rules, that apply to the user, to grant them additional permissions. - - A list of ``ir.rule`` records, each with a :ref:`domain ` - that is used to select the records to which the rule applies. + - A list of `Rule ` records, each with a :ref:`domain + ` that is used to select the records to which the rule + applies. A rule group matches a record if the record is validated by at least one of the domains. diff --git a/trytond/doc/topics/cron.rst b/trytond/doc/topics/cron.rst index bc4b37de48..4503d25ba8 100644 --- a/trytond/doc/topics/cron.rst +++ b/trytond/doc/topics/cron.rst @@ -7,17 +7,18 @@ Scheduled Actions Tryton provides a scheduler (aka cron) which can execute methods of :ref:`models ` periodically at set intervals. -The planning is managed by ``ir.cron`` records which store the method to call -and the interval of time between calls. The method must be a class method of a -:class:`~trytond.model.Model` which can be called without any parameters. +The planning is managed by `Cron ` records which store the +method to call and the interval of time between calls. +The method must be a class method of a :class:`~trytond.model.Model` which can +be called without any parameters. .. note:: The timezone used to schedule the action is :attr:`timezone.SERVER `. -To register a new method with the scheduler, you must extend the ``ir.cron`` -model and append the new method to the +To register a new method with the scheduler, you must extend the `Cron +` model and append the new method to the :attr:`~trytond.model.fields.Selection.selection` attribute of the ``method`` field in :meth:`~trytond.model.Model.__setup__()`. The name of the selection must be the model name and the method name joined together with a ``|`` between diff --git a/trytond/doc/topics/modules/index.rst b/trytond/doc/topics/modules/index.rst index 3dc1cb9b72..4a45816ddb 100644 --- a/trytond/doc/topics/modules/index.rst +++ b/trytond/doc/topics/modules/index.rst @@ -192,7 +192,7 @@ Here is the list of the tags: other types, it is required to use the ``eval`` attribute. ``menuitem`` - Shortcut to create ``ir.ui.menu`` records. + Shortcut to create `Menu ` records. Here is the list of attributes: ``id`` diff --git a/trytond/doc/topics/reports/index.rst b/trytond/doc/topics/reports/index.rst index 57560c34cf..dade5e3758 100644 --- a/trytond/doc/topics/reports/index.rst +++ b/trytond/doc/topics/reports/index.rst @@ -29,7 +29,8 @@ These are specific to ODT files. .. _relatorio: https://relatorio.tryton.org/ .. _Genshi: https://genshi.edgewall.org/ -When defining an ``ir.action.report`` the following attributes are available: +When defining a `Report ` the following attributes are +available: ``name`` The name of the report. @@ -174,8 +175,8 @@ Creating a simple report template for a model within a module ------------------------------------------------------------- Once you have created a report template stored in your module, you must create -an XML record of ``ir.action.report`` and another XML record of -``ir.action.keyword`` like: +an XML record for the `Report ` and another XML record for the +`Action Keyword ` like: .. code-block:: xml diff --git a/trytond/doc/topics/task_queue.rst b/trytond/doc/topics/task_queue.rst index de25f47611..d0c4b92361 100644 --- a/trytond/doc/topics/task_queue.rst +++ b/trytond/doc/topics/task_queue.rst @@ -18,8 +18,8 @@ The first argument of the method must be an instance or a list of instances of :class:`~trytond.model.Model`. This other arguments must be JSON-ifiable. -A task is pushed into the ``queue`` by calling the desired method on the -:attr:`~trytond.model.Model.__queue__`. +A task is pushed into the `Queue ` by calling the desired +method on the :attr:`~trytond.model.Model.__queue__`. This stores in the queue all the current parameters of the call and it will be execute by a worker or at the end of the transaction if no worker is configured. diff --git a/trytond/doc/topics/translation.rst b/trytond/doc/topics/translation.rst index 6f7d32da98..e0b76185a8 100644 --- a/trytond/doc/topics/translation.rst +++ b/trytond/doc/topics/translation.rst @@ -12,7 +12,7 @@ The official language files are named after the `POSIX locale standard, e.g. de.po, es.po, es_AR.po, es_EC.po... The names of custom language files must match the code of the language in the -:class:`~trytond.model.Model` ``ir.lang``. +`Language `. If a language is set ``translatable``, the translations is loaded into the database on each update. @@ -59,11 +59,12 @@ To override the translation of another module the ``msgctxt`` string must have the following content: ``type:name:module.xml_id`` type - The field type of ir.translation. + The field type of `Translation `. name - The field name of ir.translation. + The field name of *Translation*. module - The field module ir.translation. + The field module *Translation*. xml_id - The XML id that is stored in ``ir.model.data`` as ``fs_id``. + The XML id that is stored in `Model Data ` as + ``fs_id``. It is optional and can be omitted if it is None. diff --git a/trytond/doc/topics/triggers.rst b/trytond/doc/topics/triggers.rst index 33681ea3ec..89dc731887 100644 --- a/trytond/doc/topics/triggers.rst +++ b/trytond/doc/topics/triggers.rst @@ -18,11 +18,12 @@ The method signature is:: (cls, records, trigger) Where ``records`` is the list of records that triggered the event and -``trigger`` is the ``ir.trigger`` instance which is triggered. +``trigger`` is the `Trigger ` instance which is triggered. -Triggers are defined by records of ``ir.trigger``. Each record must define a -pyson condition which will be evaluated when the event occurs. Only those -records for which the condition is evaluated to true will be processed by the -trigger with the exception of modification triggers which will only process the -records for which the condition is evaluated to false before and evaluated to -true after the modification. +Triggers are defined by records of `Trigger `. +Each record must define a :class:`~trytond.pyson.PYSON` condition which will be +evaluated when the event occurs. +Only those records for which the condition is evaluated to true will be +processed by the trigger with the exception of modification triggers which will +only process the records for which the condition is evaluated to false before +and evaluated to true after the modification. diff --git a/trytond/doc/topics/views/extension.rst b/trytond/doc/topics/views/extension.rst index 44912065a1..2d851f34ec 100644 --- a/trytond/doc/topics/views/extension.rst +++ b/trytond/doc/topics/views/extension.rst @@ -7,7 +7,7 @@ Extending View Extending a view means, that the original view will be modified by a set of rules which are defined with XML. For this purpose, the extension engine uses XPath_ expressions. -The view is defined with the field ``inherit`` of the ``ir.ui.view``. +The view is defined with the `View `'s ``inherit`` field. If the field :ref:`domain ` is not set or evaluated to ``True``, the inheritance will be proceeded. diff --git a/trytond/doc/topics/views/index.rst b/trytond/doc/topics/views/index.rst index 5499337ce1..07622c7c42 100644 --- a/trytond/doc/topics/views/index.rst +++ b/trytond/doc/topics/views/index.rst @@ -11,7 +11,7 @@ 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 :file:`view` directory of -the module or in the databases thanks to the model ir.ui.view. +the module or in the databases thanks to the `View `. So generally, they are defined in XML files with this kind of XML where name is the name of the XML file in the :file:`view` directory: @@ -398,7 +398,8 @@ Display an image with those attributes: ``name`` The image name or the field name which contains the image name. - For the ``icon`` type it must be the name of a record of ``ir.ui.icon``. + For the ``icon`` type it must be the name of an `Icon ` + record. For the ``url`` type it must be the URL. It can be relative to the server. ``url_size`` @@ -462,8 +463,8 @@ Display a button with those attributes: ``button(cls, records)`` - The function may return an ``ir.action`` id or one of those client side - action keywords: + The function may return an `Action ` id or one of these + client side action keywords: .. _topics-views-client-actions: @@ -507,22 +508,22 @@ Display a button with those attributes: :ref:`help `. .. warning:: - The button should be registered on ``ir.model.button`` where the default - value of the ``string``, ``confirm`` and ``help`` attributes can be can be - defined. + The button should be registered as a `Model Button ` + where the default value of the ``string``, ``confirm`` and ``help`` + attributes can be can be defined. .. _form-link: link ---- -Display an ``ir.action.act_window`` as a button with a counter or one counter -per tab. +Display an `Window Action ` as a button with a +counter or one counter per tab. When clicked it opens the window. The available attributes are: ``name`` - The XML id of ``ir.action.act_window``. + The XML id of `Window Action `. ``icon`` The name of the icon to display. @@ -628,7 +629,7 @@ A tree view is used to display records inside a list or a tree. It is a tree if there is a ``field_childs`` defined and this tree has the drag and drop activated if the ``field_childs`` and the ``parent field`` are defined -in the ``ir.ui.view`` record. +in the `View ` record. The columns of the view are put on the screen from left to right. @@ -751,7 +752,8 @@ displayed in the same column with the attributes: ``icon`` The image name or the field name which contains the image name. - For the ``icon`` type it must be the name of a record of ``ir.ui.icon``. + For the ``icon`` type it must be the name of an `Icon ` + record. For the ``url`` type it must be the URL and it can be relative to the server. ``icon_type`` diff --git a/trytond/doc/tutorial/module/default_values.rst b/trytond/doc/tutorial/module/default_values.rst index ce9b76859c..2dc0f42e3c 100644 --- a/trytond/doc/tutorial/module/default_values.rst +++ b/trytond/doc/tutorial/module/default_values.rst @@ -32,8 +32,8 @@ following class method is added in :file:`opportunity.py` file: Call other model methods ------------------------ -In the previous example we called the ``today`` method of the ``ir.date`` model -from the :class:`~trytond.pool.Pool` instance. +In the previous example we called the ``today`` method of the `Date +` model from the :class:`~trytond.pool.Pool` instance. The :attr:`~trytond.model.Model.__name__` value is used to get the class. It is very important to get the class from the pool instead of using a normal Python import, because the pool ensures that all of the extensions are applied diff --git a/trytond/doc/tutorial/module/extend.rst b/trytond/doc/tutorial/module/extend.rst index c293b8ce51..8ee624e448 100644 --- a/trytond/doc/tutorial/module/extend.rst +++ b/trytond/doc/tutorial/module/extend.rst @@ -43,8 +43,8 @@ Extend the Party view Now that we added a new field to the ``party.party`` :class:`~trytond.model.Model`, we can also add it the form view. -This is done by adding a ``ir.ui.view`` record that inherit the party form view -of the ``party`` module. +This is done by adding a `View ` record that inherit the +party form view of the ``party`` module. Here is the content of the :file:`party.xml` file: .. code-block:: xml diff --git a/trytond/doc/tutorial/module/report.rst b/trytond/doc/tutorial/module/report.rst index f468d5b874..ad601d1987 100644 --- a/trytond/doc/tutorial/module/report.rst +++ b/trytond/doc/tutorial/module/report.rst @@ -28,8 +28,8 @@ And we register it in the :class:`~trytond.pool.Pool` as type ``report`` in module='opportunity', type_='report') -Now we have to create a ``ir.action.report`` and ``ir.action.keyword`` in -:file:`opportunity.xml`: +Now we have to create a `Report ` and `Action Keyword +` in :file:`opportunity.xml`: .. code-block:: xml @@ -51,8 +51,8 @@ Now we have to create a ``ir.action.report`` and ``ir.action.keyword`` in -The ``ir.action.report`` links the ``trytond.report.Report`` with the -:class:`~trytond.model.Model`. +The `Report ` links the :class:`~trytond.report.Report` +with the :class:`~trytond.model.Model`. ``name`` The string that is shown on the menu. @@ -65,9 +65,9 @@ The ``ir.action.report`` links the ``trytond.report.Report`` with the ``template_extension`` The template format. -And like for the :ref:`wizard `, the -``ir.action.keyword`` makes the ``trytond.report.Report`` available as action -to any ``training.opportunity``. +And like for the :ref:`wizard `, the `Action Keyword +` makes the :class:`~trytond.report.Report` available as +action to any ``training.opportunity``. Finally we create the OpenDocument_ template as :file:`opportunity.fodt` using LibreOffice_. diff --git a/trytond/doc/tutorial/module/view.rst b/trytond/doc/tutorial/module/view.rst index 4ede37ea05..36d7186fb5 100644 --- a/trytond/doc/tutorial/module/view.rst +++ b/trytond/doc/tutorial/module/view.rst @@ -126,8 +126,8 @@ Now we have to declare the XML data file in the :file:`tryton.cfg` file: Create menu entry ----------------- -In order to show our models on the user menu we need an -``ir.action.act_window`` and a menu entry. +In order to show our models on the user menu we need an `Window Action +` and a menu entry. An action window is used to relate one or more views, usually a list and a form view. diff --git a/trytond/doc/tutorial/module/wizard.rst b/trytond/doc/tutorial/module/wizard.rst index 935b49fdfd..f957ca061b 100644 --- a/trytond/doc/tutorial/module/wizard.rst +++ b/trytond/doc/tutorial/module/wizard.rst @@ -110,8 +110,8 @@ And we register it in the :class:`~trytond.pool.Pool` as type ``wizard`` in opportunity.Convert, module='opportunity', type_='wizard') -Finally we just need to create a ``ir.action.wizard`` and ``ir.action.keyword`` -in :file:`opportunity.xml`: +Finally we just need to create a `Wizard ` and an +`Action Keyword ` in :file:`opportunity.xml`: .. code-block:: xml @@ -131,8 +131,8 @@ in :file:`opportunity.xml`: -The ``ir.action.wizard`` links the :class:`~trytond.wizard.Wizard` with the -:class:`~trytond.model.Model`. +The `Wizard ` links the :class:`~trytond.wizard.Wizard` +with the :class:`~trytond.model.Model`. ``name`` The string that is shown on the menu. @@ -141,8 +141,9 @@ The ``ir.action.wizard`` links the :class:`~trytond.wizard.Wizard` with the ``model`` The name of the :class:`~trytond.model.Model`. -And the ``ir.action.keyword`` makes the :class:`~trytond.wizard.Wizard` -available as action to any ``training.opportunity``. +And the `Action Keyword ` makes the +:class:`~trytond.wizard.Wizard` available as action to any +``training.opportunity``. ``keyword`` The type of `keyword `. diff --git a/trytond/doc/tutorial/module/workflow.rst b/trytond/doc/tutorial/module/workflow.rst index 0d9af62777..abb500d8ef 100644 --- a/trytond/doc/tutorial/module/workflow.rst +++ b/trytond/doc/tutorial/module/workflow.rst @@ -98,8 +98,8 @@ dictionary and decorate the transition method with the def lost(cls, opportunities): ... -Every button must also be recorded in ``ir.model.button`` to define its label -(and also the :ref:`access right `). +Every button must also be recorded as a `Model Button ` to +define its label (and also the :ref:`access right `). We must add to the ``opportunity.xml`` file: .. code-block:: xml