summaryrefslogtreecommitdiff
path: root/addons/project/project_data.xml
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2015-10-06 14:33:20 +0200
committerDamien Bouvy <dbo@odoo.com>2015-10-16 16:38:25 +0200
commit31ff6c68f4b49d5c12e2487d369a338c51f8997b (patch)
tree5e90f23c2bb914df6d9570b471594b6c12b6bc49 /addons/project/project_data.xml
parentbe5fc7b1a4fe91272bc48d16068ad299aa6585ba (diff)
[FIX] project, sale_timesheet: common field between non-dependent modules workaround
The project and sale_timesheet modules both define a project_time_mode_id field on res.company but they are not dependent on each other. This causes problem because the first module that creates the field "wins" the xmlid and will delete the field on uninstall, regardless of the other module (which will then stop working until you do an update that will recreate the field). To work around this in a stable version, we manually create xmlids for the field in each module; on uninstall the field will not be deleted if an xmlid still refers it (which will be the case if the other module is installed). Inheriting fields from modules that are not dependent in a direct way (ancestor-child) is not supported, so normally you should use modularity to define the field in a parent module. Since 9.0 is a stable version, we need a small workaround.
Diffstat (limited to 'addons/project/project_data.xml')
-rw-r--r--addons/project/project_data.xml12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/project/project_data.xml b/addons/project/project_data.xml
index 8ffc7ad91c1..c1d87077064 100644
--- a/addons/project/project_data.xml
+++ b/addons/project/project_data.xml
@@ -21,6 +21,17 @@
<!-- alias domain: project.config.settings -->
<function id="default_alias_domain_project" model="ir.values" name="set_default" eval="('project.config.settings', 'generate_project_alias', 1)"/>
+
+ <!-- sale_timesheet and project define the same field without depending on each, which causes the field to be deleted when the module that created it
+ is deleted. To avoid this, we create xmlids manually for this field in both modules to prevent accidental deletion. To fix in saas-7 by moving the field definition-->
+ <record id="duplicate_field_xmlid" model="ir.model.data">
+ <field name="res_id" search="[('model','=','res.company'),('name','=','project_time_mode_id')]" model="ir.model.fields"/>
+ <field name="model">ir.model.fields</field>
+ <field name="module">project</field>
+ <field name="name">project_time_mode_id_duplicate_xmlid</field>
+ <field name="noupdate">True</field>
+ </record>
+
</data>
<data>
@@ -319,6 +330,5 @@
<field name="displayed_image_id" ref="msg_task_data_14_attach"/>
</record>
-
</data>
</openerp>