Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5223 มุมมอง

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?

คำตอบที่ดีที่สุด
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.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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)
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
7122
1
มี.ค. 18
4791
1
มี.ค. 15
11202
0
มี.ค. 15
4080
1
มี.ค. 15
4403