Fix doc conf

Add introduction
Fix title level in models
Complete modules
Typo fix in views
This commit is contained in:
Cédric Krier
2008-11-04 19:11:39 +01:00
parent a5c0e982a6
commit 2f0ca8f784
7 changed files with 279 additions and 96 deletions
+5 -5
View File
@@ -36,16 +36,16 @@ source_suffix = '.rst'
master_doc = 'index'
# General substitutions.
project = 'Trytond'
project = 'trytond'
copyright = '2008, B2CK'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
#
# The short X.Y version.
version = '0.1'
version = '0.0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = '0.0.1'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
@@ -126,7 +126,7 @@ html_last_updated_fmt = '%b %d, %Y'
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Trytonddoc'
htmlhelp_basename = 'trytonddoc'
# Options for LaTeX output
@@ -141,7 +141,7 @@ htmlhelp_basename = 'Trytonddoc'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', 'Trytond.tex', 'Trytond Documentation', 'Bertrand Chenal, Cédric Krier',
('index', 'trytond.tex', 'trytond Documentation', 'Bertrand Chenal, Cédric Krier',
'manual'),
]
+3 -2
View File
@@ -2,14 +2,15 @@
completely to your liking, but it should at least contain the root
`toctree` directive.
Welcome to Trytond's documentation!
###################################
Index
#####
Contents:
.. toctree::
:maxdepth: 2
introduction
installation
models
views
+3 -1
View File
@@ -1,2 +1,4 @@
Installation
############
############
see INSTALL file.
+9
View File
@@ -0,0 +1,9 @@
Introduction
############
Tryton is a three-tiers high-level general purpose application platform
written in Python and use Postgresql as database engine.
It is the core base of an Open Source ERP.
It provides modularity, scalability and security.
+8 -8
View File
@@ -581,12 +581,12 @@ otherwise in the description.
Manipulating Models
###################
*******************
.. module:: OSV
Create
******
^^^^^^
.. method:: create(self, cursor, user, vals[, context])
@@ -602,7 +602,7 @@ Create
:return: An integer, the id of the new record.
Read
****
^^^^
.. method:: read(self, cursor, user, ids[, fields_names, context])
@@ -623,7 +623,7 @@ Note: one should favour ``browse`` over ``read``, because it's more
powerful.
Browse
******
^^^^^^
.. method:: browse(self, cursor, user, ids[, context])
@@ -660,7 +660,7 @@ the data in a pythonic way.
Write
*****
^^^^^
.. method:: write(self, cursor, user, ids, vals[, context])
@@ -679,7 +679,7 @@ Write
Delete
******
^^^^^^
.. method:: delete(self, cursor, user, ids[, context])
@@ -697,7 +697,7 @@ Delete
Search
******
^^^^^^
.. method:: search(self, cursor, user, args[, offset, limit, order,context, count, query_string])
@@ -781,7 +781,7 @@ user.):
.. _define_inheritance:
Models Inheritance
##################
******************
Model Inheritance allow add or override fields, methods and
constraints on existing models. To inherit an existing model (like
+168 -1
View File
@@ -1,2 +1,169 @@
Modules
#######
#######
The modules of Tryton extend the functionality of the platform. The server
comes by default with only a few functionality included in those modules:
ir, res, webdav, workflow
Module Structure
****************
A module is a directory in trytond/modules that contains at least two files:
* ``__init__.py``: a Tryton module must be a Python module.
* ``__tryton__.py``: a Python file that describes the Tryton module.
``__init__.py`` file
^^^^^^^^^^^^^^^^^^^^
It is the Python ``__init__.py`` to define a module. It must import all the python files from the module.
``__tryton__.py`` file
^^^^^^^^^^^^^^^^^^^^^^
It is a Python file that must contain only dictionary with those keywords:
* ``name``: The name of the module.
* ``version``: The version number of the module.
* ``author``: The author name of the module.
* ``email``: The email address of the module (optional).
* ``website``: The url of the website for the module (optional).
* ``category``: A category for the module (optional).
* ``description``: A long description of the module.
* ``depends``: A list of modules on which the module depends.
* ``xml``: The list of the XML files of the module. There will be loaded at the installation or update of the module.
* ``translation``: The list of csv files that contains the translation. The name of the files must be the language code.
Here is an example:
.. highlight:: python
::
{
"name" : "Party",
"version" : "0.0.1",
"author" : "B2CK",
'email': 'info@b2ck.com',
'website': 'http://www.tryton.org/',
"category" : "Generic",
"description": "Define parties, addresses and co.",
"depends" : [
"ir",
"res",
"country",
],
"xml" : [
"party.xml",
"category.xml",
"address.xml",
"contact_mechanism.xml",
],
'translation': [
'fr_FR.csv',
'de_DE.csv',
'es_ES.csv',
],
}
Python files
************
The Python files defines the Models for the modules.
XML files
*********
The XML files defines data that will be inserted into the database.
There is an rnc for those files stored in ``trytond/tryton.rnc``.
The following snippet gives a first idea of what looks a xml file:
.. highlight:: xml
::
<?xml version="1.0"?>
<tryton>
<data>
<record model="res.group" id="group_party_admin">
<field name="name">Party Administration</field>
</record>
<record model="res.user" id="res.user_admin">
<field name="groups" eval="[('add', ref('group_party_admin'))]"/>
</record>
<menuitem name="Party Management" sequence="0" id="menu_party"
icon="tryton-users"/>
<record model="ir.ui.view" id="party_view_tree">
<field name="model">party.party</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<![CDATA[
<tree string="Parties">
<field name="code" select="1"/>
<field name="name" select="1"/>
<field name="lang" select="2"/>
<field name="vat_code" select="1"/>
<field name="active" select="2" tree_invisible="1"/>
<field name="vat_country" select="2" tree_invisible="1"/>
<field name="vat_number" select="2" tree_invisible="1"/>
</tree>
]]>
</field>
</record>
</data>
</tryton>
Here is the list of the tags:
* ``tryton``: The main tag of the xml
* ``data``: Define a set of data inside the file. It can have the attributes ``noupdate`` to prevent the framework to update the records.
* ``record``: Create a record of the model defined by the attribute ``model`` in the database. The ``id`` attribute can be use to refer to the record later in any xml file.
* ``field``: Set the value of the field with the name defined by the attribute ``name``.
Here is the list of attributes:
* ``search``: Only for relation field, it contains a domain on which searching for the first record and use it as value.
* ``ref``: Only for relation field, it contains a xml id of the relation to use as value. It must be preceed by the module name with a ending dot if the record is defined in an other module.
* ``eval``: Python code to evaluate and use result as value.
* ``type``: If set to xml, it will use the CDATA content as value.
* ``menuitem``: Shortcut to create ir.ui.menu records.
Here is the list of attributes:
* ``id``: The id of the menu.
* ``name``: The name of the menu.
* ``icon``: The icon of the menu.
* ``sequence``: The sequence value used to order the menu entries.
* ``parent``: The xml id of the parent menu.
* ``action``: The xml id of the action linked to the menu.
* ``groups``: A list of xml id of group, that have access to the menu, separated by commas.
+83 -79
View File
@@ -57,22 +57,26 @@ XML description
Here is the list of common attributes:
* "expand": A boolean to specify if the label should expand to take up any extra horizontal space.
* ``expand``: A boolean to specify if the label should expand to take up any extra horizontal space.
* "fill": A boolean to specify if the label should fill the horizontal space allocated to it in the table cell.
* ``fill``: A boolean to specify if the label should fill the horizontal space allocated to it in the table cell.
* "xexpand": The same as expand but for vertical space.
* ``xexpand``: The same as expand but for vertical space.
* "xfill": The same as fill but for vertical space.
* ``xfill``: The same as fill but for vertical space.
* "colspan": The number of columns the label must take in the table.
* ``colspan``: The number of columns the label must take in the table.
* "states": A string of python code that will be evaluated with the field of the current record. It must return a dictionary where keys can be:
* 'invisible': If true, the widget will be hidden.
* 'required': If true, the field will be required.
* 'readonly': If true, the field will be readonly.
* ``states``: A string of python code that will be evaluated with the field of the current record.
* "help": The string that will be displayed when the cursor stay over the widget.
It must return a dictionary where keys can be:
* ``invisible``: If true, the widget will be hidden.
* ``required``: If true, the field will be required.
* ``readonly``: If true, the field will be readonly.
* ``icon``: Only for button, it must return the icon name to use or False.
* ``help``: The string that will be displayed when the cursor stay over the widget.
form
@@ -80,24 +84,24 @@ form
Each form view must start with this tag.
* "string": The text that will be used as default title for the tab or the window.
* ``string``: The text that will be used as default title for the tab or the window.
* "on_write": The name of a function that will be called when the record is saved. The function must have this form "on_write(self, cursor, user, ids, context=None)".
* ``on_write``: The name of a function that will be called when the record is saved. The function must have this form ``on_write(self, cursor, user, ids, context=None)``.
* "col": The number of column for the view.
* ``col``: The number of column for the view.
* "cursor": The name of the field that must have the cursor by default.
* ``cursor``: The name of the field that must have the cursor by default.
label
^^^^^
Display static string.
* "string": The string that will be display in the label.
* ``string``: The string that will be display in the label.
* "name": The name of the field from which the description will be used for string.
* ``name``: The name of the field from which the description will be used for string.
* "align": The fraction of horizontal free space that must be put on the left. 0.0 means no free space to the left. 1.0 means all free space to the left.
* ``align``: The fraction of horizontal free space that must be put on the left. 0.0 means no free space to the left. 1.0 means all free space to the left.
field
@@ -105,29 +109,29 @@ field
Display a field of the object with the value of the current record.
* "name": The name of the field.
* ``name``: The name of the field.
* "widget": The widget that must be used instead of the default one.
* ``widget``: The widget that must be used instead of the default one.
* "saves": Only for One2Many fields, it is a boolean that defined if change made in the list must be save directly.
* ``saves``: Only for One2Many fields, it is a boolean that defined if change made in the list must be save directly.
* "help": The string that will be displayed when the cursor stay over the widget.
* ``help``: The string that will be displayed when the cursor stay over the widget.
* "width": The minimum width the widget should request, or -1 to unset.
* ``width``: The minimum width the widget should request, or -1 to unset.
* "height": The minimum height the widget should request, or -1 to unset.
* ``height``: The minimum height the widget should request, or -1 to unset.
* "readonly": Boolean to set the field readonly.
* ``readonly``: Boolean to set the field readonly.
* "required": Boolean to set the field required.
* ``required``: Boolean to set the field required.
* "mode": Only for One2Many fields, it is a comma separated list, that specify the order of of the view used to display the relation. (Example: "tree,form")
* ``mode``: Only for One2Many fields, it is a comma separated list, that specify the order of of the view used to display the relation. (Example: ``tree,form``)
* "completion": Only for Many2One fields, it is a boolean to set the completion of the field.
* ``completion``: Only for Many2One fields, it is a boolean to set the completion of the field.
* "invisible": The field will not be display, but it will fill cells in the table.
* ``invisible``: The field will not be display, but it will fill cells in the table.
* "domain": Only for One2Many, Many2One, Many2Many fields, it defines the domain that must be used when searching for relation records.
* ``domain``: Only for One2Many, Many2One, Many2Many fields, it defines the domain that must be used when searching for relation records.
image
@@ -135,16 +139,16 @@ image
Display a image.
* "name": the name of the image. It must be the name with the extension of an image from tryton/share/pixmaps/
* ``name``: the name of the image. It must be the name with the extension of an image from tryton/share/pixmaps/
separator
^^^^^^^^^
Display a horizontal separator.
* "string": The string that will be display above the separator.
* ``string``: The string that will be display above the separator.
* "name": The name of the field from which the description will be used for string.
* ``name``: The name of the field from which the description will be used for string.
newline
^^^^^^^
@@ -156,54 +160,54 @@ button
Display a button.
* "string": The string that will be display inside the button.
* ``string``: The string that will be display inside the button.
* "type": It can be "workflow", "object" or "action". The default is "workflow".
* ``type``: It can be ``workflow``, ``object`` or ``action``. The default is ``workflow``.
It defines which type of action must be run when clicking on it.
* "name": The name of the action:
* ``name``: The name of the action:
* "workflow": the name of the signal that will be send.
* ``workflow``: the name of the signal that will be send.
* "object": the name of the function that will called. The function must have this form "button(self, cursor, user, ids, context=None)".
* ``object``: the name of the function that will called. The function must have this form ``button(self, cursor, user, ids, context=None)``.
* "action": the id of the ir.action that will be called.
* ``action``: the id of the ir.action that will be called.
* "confirm": A text that will be display in a confirmation popup when the button is clicked.
* ``confirm``: A text that will be display in a confirmation popup when the button is clicked.
notebook
^^^^^^^^
It adds a notebook widget which can contain page tags.
* "tabpos": It can be "up", "down", "left", "right".
* ``tabpos``: It can be ``up``, ``down``, ``left``, ``right``.
page
^^^^
Define a new tab inside a notebook.
* "string": The string that will be display in the tab.
* ``string``: The string that will be display in the tab.
* "angle": The angle that the baseline of the label makes with the horizontal, in degrees, measured counterclockwise.
* ``angle``: The angle that the baseline of the label makes with the horizontal, in degrees, measured counterclockwise.
* "col": The number of column for the page view.
* ``col``: The number of column for the page view.
group
^^^^^
Create a sub-table in a cell.
* "string": If set a frame will be drawn around the field with a label containing the string. Otherwise, the frame will be invisible.
* ``string``: If set a frame will be drawn around the field with a label containing the string. Otherwise, the frame will be invisible.
* "rowspan": The number of rows the group must take in the table.
* ``rowspan``: The number of rows the group must take in the table.
* "col": The number of column for the group contains.
* ``col``: The number of column for the group contains.
hpaned, vpaned
^^^^^^^^^^^^^^
* "position": The pixel position of divider, a negative value means that the position is unset
* ``position``: The pixel position of divider, a negative value means that the position is unset
child1,child2
^^^^^^^^^^^^^
@@ -276,40 +280,40 @@ tree
Each tree view must start with this tag.
* "string": The text that will be used as default title for the tab or the window.
* ``string``: The text that will be used as default title for the tab or the window.
* "on_write": The name of a function that will be called when a record is saved. The function must have this form "on_write(self, cursor, user, ids, context=None)".
* ``on_write``: The name of a function that will be called when a record is saved. The function must have this form ``on_write(self, cursor, user, ids, context=None)``.
* "editable": If it is set to "top" or "bottom", the list become editable and the new record will be add on "top" or "bottom" of the list.
* ``editable``: If it is set to ``top`` or ``bottom``, the list become editable and the new record will be add on ``top`` or ``bottom`` of the list.
* "sequence": The name of the field that is used for sorting. So this field must be an interger and it will be updated to match the new sort when the user use the "Drag and Drop" between rows of the list.
* ``sequence``: The name of the field that is used for sorting. So this field must be an interger and it will be updated to match the new sort when the user use the ``Drag and Drop`` between rows of the list.
* "colors": A string that is a list of color specification separated by ';'. The specifications have this form: "color name:test". The tests is evaluated on each rows and when one return True, than the color is used to highlight the row.
* ``colors``: A string that is a list of color specification separated by ';'. The specifications have this form: ``color name:test``. The tests is evaluated on each rows and when one return True, than the color is used to highlight the row.
* "fill": A boolean to specify if the last column must fill the remain free space in the view.
* ``fill``: A boolean to specify if the last column must fill the remain free space in the view.
* "toolbar": A boolean to specify on tree if there is a toolbar on the left that take the first elements of the tree (like for the menu).
* ``toolbar``: A boolean to specify on tree if there is a toolbar on the left that take the first elements of the tree (like for the menu).
field
^^^^^
* "name": The name of the field.
* ``name``: The name of the field.
* "readonly": Boolean to set the field readonly.
* ``readonly``: Boolean to set the field readonly.
* "required": Boolean to set the field required.
* ``required``: Boolean to set the field required.
* "widget": The widget that must be used instead of the default one.
* ``widget``: The widget that must be used instead of the default one.
* "select": A number between 0 and 2. If set to 1, the field will be used as main search criteria; if set to 2, the field will be used as second search criteria; if set to 0, the field will not be used as search criteria.
* ``select``: A number between 0 and 2. If set to 1, the field will be used as main search criteria; if set to 2, the field will be used as second search criteria; if set to 0, the field will not be used as search criteria.
* "tree_invisible": Boolean to display or not the column.
* ``tree_invisible``: Boolean to display or not the column.
* "icon": The name of the field that contains the name of the icon to display in the column.
* ``icon``: The name of the field that contains the name of the icon to display in the column.
* "sum": A text for the sum widget that will be added on the bottom of list with the sum of all the field in the column.
* ``sum``: A text for the sum widget that will be added on the bottom of list with the sum of all the field in the column.
* "width": Set the width of the column.
* ``width``: Set the width of the column.
Example
+++++++
@@ -342,42 +346,42 @@ graph
Each graph view must start with this tag.
* "type": vbar, hbar, line, pie
* ``type``: vbar, hbar, line, pie
* "string": the name of the graph
* ``string``: the name of the graph
* "background": an hexaecimal value for the color of the
* ``background``: an hexaecimal value for the color of the
background
* "color": the main color
* ``color``: the main color
* "legend": a boolean to specify if the legend must be display
* ``legend``: a boolean to specify if the legend must be display
x, y
^^^^
Describe the field that must be used for axis. "x" must contain
only one tag "field" and "y" must at least one but may contain
Describe the field that must be used for axis. ``x`` must contain
only one tag ``field`` and ``y`` must at least one but may contain
many.
field
^^^^^
* "name": the name of the field on the object to use
* ``name``: the name of the field on the object to use
* "string": allow to override the string that comes from the
* ``string``: allow to override the string that comes from the
object
* "key": can be used to distinguish fields with the same name but
* ``key``: can be used to distinguish fields with the same name but
that are different with domain
* "domain": a string that is evaluate with the object value as
* ``domain``: a string that is evaluate with the object value as
context. If the result is true the field value is added to the
graph otherwise not
* "fill": defined if the graph must be fill
* ``fill``: defined if the graph must be fill
* "empty": defined if the line graph must put a point for missing
* ``empty``: defined if the line graph must put a point for missing
date
@@ -405,7 +409,7 @@ Inherited a view means that the original view will be modified by a set of rules
For this purpose, the inheritance engine use some xpath expressions.
The inherited view is defined with the field "inherit" of the ir.ui.view.
The inherited view is defined with the field ``inherit`` of the ir.ui.view.
XML description
@@ -419,9 +423,9 @@ Each inherit view must start with this tag.
xpath
^^^^^
* "expr": the xpath expression to find a node in the inherited view.
* ``expr``: the xpath expression to find a node in the inherited view.
* "position": Define the position from the finded node, it can be "before", "after", "replace", "inside".
* ``position``: Define the position from the finded node, it can be ``before``, ``after``, ``replace``, ``inside``.
Example
+++++++