Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hello
If you want module should auto install at the time of database creation you can make it auto installable by changeing __openerp__.py file like:
# -*- coding: utf-8 -*-
{
'name': 'Auto install',
'category': 'Hidden',
'version': '8.0.1.0',
'description':
"""
OpenERP auto instal module
=============================
""",
'depends': ['web'],
'auto_install': True,
'init_xml' : ["static/src/xml/template.xml",],
'qweb' : ['static/src/xml/base.xml',],
'js' : ['static/src/js/main.js'],
'bootstrap': True,
}
If you want to install module on any button event from your custome module you can use below code:
module_obj = pool.get('ir.module.module')
module_list = ['sale','purchase']
module_ids_to_install = module_obj.search(cr, 1, [('name','in',module_list)])
module_obj.update_list(cr, 1, context=None) // just to update module list to update new module added
module_obj.button_immediate_install(cr, 1, module_ids_to_install, context=context)
Updated for v15:
Inside a Server Action / Automated Action / Scheduled Action:
env['ir.module.module'].search([('name','=','stock')],limit=1).button_immediate_install()
Inside a module:
self.env['ir.module.module'].search([('name','=','stock')],limit=1).button_immediate_install()
in __openerp__.py, set 'auto_install': True,
thx for replying but i need install coutom module
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký