Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
12 Trả lời
111699 Lượt xem

in the Odoo user interface we can update module list from settings, at "Settings/Modules/Update Module List"...

How to do the same operation with command line (using odoo.py) ?

Ảnh đại diện
Huỷ bỏ
Tác giả

I found related question [1] , but with no answer... [1] https://www.odoo.com/forum/help-1/question/update-from-command-line-exactly-as-fast-as-via-update-module-list-in-ui-75449

Tác giả

and another one with an accepted answer: https://www.odoo.com/forum/help-1/question/is-update-module-list-from-command-line-possible-54578 but

 ./odoo.py -u base
takes too long, however when we update list from ui, it's fairly faster then update of base module with -u base or -i base... so it's not the same operation or equivalent...
Tác giả

any suggestions?

Câu trả lời hay nhất

You can create xml-file that calls ir.module.module objects update_list function. Like this:

<openerp>
    <data>
        <function model="ir.module.module" name="update_list"/>
    </data>
</openerp>


Now if you add this xml-file to module data (like you would add any other view definition or other xml-files) that update_list function gets called every time you update this module. For example you added this to a new module named "your_custom_module_updater",  so now you can start odoo with:

./odoo.py -u your_custom_module_updater 

and that module list should update every time from now on. 

*note: you still need to manually update the list for your_custom_module_updater to install it :)

Ảnh đại diện
Huỷ bỏ
Tác giả

nice workaround :) thanks!

thank you very much! works nicely on v9

For odoo10, How this command work? Because ./odoo.py not work for odoo10, we start our server with ./odoo-bin

Câu trả lời hay nhất

cd odoo-server/

./odoo-bin -c /etc/odoo-server.conf -d data_base_name -u module_name

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

You can update module using below command.

./odoo.py -u modulename -d databasename

Thanks.

Shamji.


Ảnh đại diện
Huỷ bỏ

I guess that's valid AFTER you have stopped the server AND reside inside of /opt/odoo/odoo-server, right?

Depend on service restart. If you use --xmlrpc-port=9999 or any port than no need to stop server which are running on 8069.

Câu trả lời hay nhất

in case of odoo 10

first grant all privileges to the db for the user.

GRANT ALL PRIVILEGES ON DATABASE "my_db" to my_user;

then open terminal ctrl + t

sudo su postgres

cd path to odoo

./odoo-bin -u module_name -d db_name


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
554
0
thg 1 24
1301
2
thg 5 23
8140
1
thg 2 22
23179
5
thg 12 21
16254