-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] project, sale_timesheet: common field between non-dependent mod…
…ules 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.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data noupdate="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">sale_timesheet</field> | ||
<field name="name">project_time_mode_id_duplicate_xmlid</field> | ||
<field name="noupdate">True</field> | ||
</record> | ||
</data> | ||
|
||
</odoo> |