Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a module that got the noupdate="1" attribute added to all views, actions and menuitems. Now those records can't be upgraded, even after the xml file in the module has been corrected. I'm already using the module, and would rather not have to reinstall it and lose the data.
Some options I've considered:
Find where the noupdate attribute is stored in the database, and change it for my records. Does anyone know how this can be done?
Delete all the records from the database. Tried it, and it works. Unfortunately the db crashes before I've goten all the records, and then I have to restore and am back to square one.
Export the data, uninstall module, reinstall, and import the data again.
The noupdate is stored in the ir_model_data table. Just change the noupdate column to FALSE for the record (search it using the XML ID against the name column). This will allow you to make "noupdate" records to be updateable in the future.
If you want to just change something in the records created by the data XML, I would recommend that you just change it via the application, e.g. for ir.ui.view --> through Settings >> Technical >> User Interface >> Views.
Records that are created in xml files also create an external identifier which is named [module name].[id]
When noupdate="1" is specified in the xml data file, then the external identifier created has a field called noupdate set to True. Once this happens, it is impossible to update a record using xml.
You can find the external identifier in Technical -> Sequences and Identifiers -> External Identifiers. Find the id of the record you're looking for and uncheck the noupdate field. Once this is done, you can update the record using your xml data file.
I had a requirement for a module to update existing records which were previously set to noupdate. This had to be done in xml. To achieve this I did the following in the data file (new_module_data.xml)
1.I deleted the record
2. I re-created the record using the original identifier
<delete id="old_module_name.identifier" model="old_module_name.model"/>
<record id="old_module_name.identifier" model="old_module_name.model">
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 2/27/15, 3:46 AM|
|Seen: 2065 times|
|Last updated: 2/14/17, 9:31 AM|