53
53
Table/Object structure
54
54
""""""""""""""""""""""
56
When you run openerp-server with option --init or --update, the table structure are updated to match the new description that is in .py files. Fields that are removed are not removed in the postgresql database not to lose data.
58
So, simply running --update or --init, will upgrade your table structure.
60
It's important to run --init=module the first time you install the module. Next time, you must use the --update=module argument instead of the init one. This is because init loads ressources that are loaded only once and never upgraded (eg: ressources with no id="" attribute or within a noupdate="1" <data> tag).
56
When you run openerp-server with option ``--init`` or ``--update``, the table
57
structure is updated to match the new description that is in Python code. Fields
58
that are removed from Python code are not removed from the postgresql database
61
So, simply running with ``--update`` or ``--init``, will upgrade your table structure.
63
It's important to run ``--init=module`` the first time you install the module.
64
Next time, you must use the ``--update=module`` argument instead of the init
65
one. This is because ``--init`` loads resources that are loaded only once and
66
never upgraded (i.e., resources with no ``id=""`` attribute or within a
67
``<data noupdate="1">`` tag). The ``noupdate`` attribute can be overridden by
68
marking a record with ``forcecreate="True"``. This means that the record will be
69
created if it doesn't already exist in the database, but it won't be modified.
110
118
This will override the invoice form view. You do not have to delete the old view, like in 3.0 versions of OpenERP.
112
Note that it is often better to use view inherytancy instead of overwritting views.
114
In this migration system, you do not have to delete any ressource. The migration system will detect if it is an update or a delete using id="..." attributes. This is important to preserve references duing migrations.
120
Note that it is often better to use view inheritance instead of overwriting views.
122
In this migration system, you do not have to delete any resource. The migration system will detect if it is an update or a delete using id="..." attributes. This is important to preserve references duing migrations.
119
Demo datas do not have to be upgraded; because they are probably modified, deleted, ... by users. So, to avoid demo data to be upgraded, you can put a noupdate="1" attribute in the <data> tag of your .xml data files.
127
Demo data do not have to be upgraded; because they are probably modified or
128
deleted by users. So, to avoid demo data to be upgraded, you can put a
129
``noupdate="1"`` attribute in the ``<data>`` tag of your .xml data files.
121
131
Summary of update and init process
122
132
++++++++++++++++++++++++++++++++++
126
modify/add/delete demo data and builtin data
136
modify/add/delete demo data and built-in data
130
modifiy/add/delete non demo data
140
modify/add/delete non demo data
132
Examples of builtin (non demo) data:
142
Examples of built-in (non demo) data:
134
144
* Menu structure,
135
145
* View definition,
136
146
* Workflow description, ...
137
-> Everything that as an id="..." in the .XML data declaration (if no attr noupdate="1" in the header)
147
* Everything that has an `id` attribute in the XML data declaration (if no attr noupdate="1" in the header)
139
What's going on on a update process:
149
What's going on during the update process:
141
151
1. If you manually added data within the client:
142
152
* the update process will not change them
143
153
2. If you dropped data:
144
154
* if it was demo data, the update process will do nothing
145
* it it was builtin data (like a view), the update process will recreate it
155
* it it was built-in data (like a view), the update process will recreate it
146
156
3. If you modified data (either in the .XML or the client):
147
157
* if it's demo data: nothing
148
* if it's builtin data, data are updated
149
4. If builtin data have been deleted in the .XML file:
158
* if it's built-in data, data are updated
159
4. If built-in data have been deleted in the .XML file:
150
160
* this data will be deleted in the database.