Odoo Help
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.
Dont understand this line of code
Look the line with WHAT IS THAT, someone can explain me why openerp do that, for me modules_to_remove_ids = ids, so why do a browse with a list a ID and build a array with the RESULT ?
def module_uninstall(self, cr, uid, ids, context=None):
"""Perform the various steps required to uninstall a module completely
including the deletion of all database structures created by the module:
tables, columns, constraints, etc."""
ir_model_data = self.pool.get('ir.model.data')
ir_model_constraint = self.pool.get('ir.model.constraint')
modules_to_remove = [m.name for m in self.browse(cr, uid, ids, context)]
modules_to_remove_ids = [m.id for m in self.browse(cr, uid, ids, context)] #<------ WHAT IS THAT
constraint_ids = ir_model_constraint.search(cr, uid, [('module', 'in', modules_to_remove_ids)])
ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context)
ir_model_data._module_data_uninstall(cr, uid, modules_to_remove, context)
self.write(cr, uid, ids, {'state': 'uninstalled'})
return True
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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 4/10/14, 12:28 PM |
Seen: 1135 times |
Last updated: 3/16/15, 8:10 AM |
I agree with you, maybe they didn't notice this. Making a browse to get the same result is lossing performance. This must be fixed.
Yeah, that does seem silly.
And look the previous line .. same browse for a other fields ... yeah..