Odoo Help

Welcome!

This community 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.

0

call update module list

By
Victor
on 11/27/13, 12:22 PM 972 views

Hello, I'm trying to develop a small py that refresh the module list. I developed a script that it can install a module but, it only installs those modules that they already are in the module list. If they don't appear in the list, the code that I developped doesn't work. So, I need to develop a script that, before to install the module that I want, refreshes the list, but I don't find any example to follow. When you are inside the web, in configuration, in the popup that it appears when you click the update module list option, I saw(in developer mode) the update button, calls the method update_module of base.module.update object. If you see this object, this method has some atributes that I don't know: def update_module(self, cr, uid, ids, context=None):

Anybody could help me, please

Thank you in advance

What are the attributes that you cannot understand?

Gopakumar N G
on 11/28/13, 3:31 AM
1

Gopakumar N G

--Gopakumar N G--
1198
| 5 3 7
Cochin, India
--Gopakumar N G--

Senior Software Engineer at BroadTech IT Solutions Pvt. Ltd.

Gopakumar N G
On 11/28/13, 3:33 AM
def update_module(self, cr, uid, ids, context=None):

Here cr is the databse cursor, uid is the user id, and ids is the list of ids and context is the optional dictionary.

0
Victor
On 11/28/13, 6:03 AM

thank you Gopakumar.

This is the code that works:

    module_obj = oerp.get('base.module.update')
    modules_to_add = module_obj.search([('state', '=', 'add')])
    module_obj.update_module(modules_to_add)

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 11/27/13, 12:22 PM
Seen: 972 times
Last updated: 3/16/15, 8:10 AM