Merge lp:~openerp-dev/openobject-server/6.0-opw-50841-nep into lp:openobject-server/6.0
Proposed by
Nehal Panchal (OpenERP)
Status: | Rejected |
---|---|
Rejected by: | Olivier Laurent (Open ERP) |
Proposed branch: | lp:~openerp-dev/openobject-server/6.0-opw-50841-nep |
Merge into: | lp:openobject-server/6.0 |
Diff against target: |
12 lines (+1/-1) 1 file modified
bin/addons/base/ir/ir_model.py (+1/-1) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/6.0-opw-50841-nep |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Laurent (Open ERP) (community) | Disapprove | ||
Naresh(OpenERP) (community) | Approve | ||
Review via email: mp+86890@code.launchpad.net |
Description of the change
Hello,
If we give same XML Identifier for the different models, it will override the data of same XML Identifier instead of creating new data in ir_model_data object.i.e
It was possible to declare the same id for different model in the same module, and this cause errors if the programmer don't see without any warning
This fixes the issue.
Thanks.
To post a comment you must log in.
Unmerged revisions
- 3559. By Nehal Panchal (OpenERP)
-
[FIX] base : Improve sql constraints for allowing same XML Identifier for the different models
The current constraint 'ir_model_ data_module_ name_uniq' on ir_model_data table is already preventing from inserting 2 records with the same name and module, so you cannot insert a record with the same xml_id ('name' field) within the same module.
Example:
if you already have a record: name: 'next_id_2', module: 'base', model: 'ir.ui.menu'
you will not be able to insert this record: 'next_id_2', module: 'base', model: 'sale.order'
because the name and module are the same as another record.
Your constraint on (name, model, module) is less restrictive than before. So if we change the current constraint (name, module) to the new one (name, model, module), we will be able to insert records having the same xml_id for the same module which will raise the problems defined in the issue.