Skip to Content
Menu
This question has been flagged
1 Reply
4020 Views

Is it possible to override module's __manifest__.py?

example:

In 'website' module, I want to add 'auto_install': True

Avatar
Discard
Best Answer

Hi,

I guess, you can't inherit manifest. But what you can do is that in your module write in the ir.module.module object. Thus, a plan should be:

  1. develop a special module which depends on 'base' only with 'auto_install': true

  2. in this module introduce a pre_init_hook, where search for required ir.module.module objects. E.g. by technical name = 'website'

  3. write in this object required data. E.g. object.auto_install = True

I think, the final behavior would be smth like:

  1. you create a database > 'base' is installed > you app is installed

  2. pre_init hook is launched > other modules are updated

  3. the required modules are auto installed.

Potential troubles:

  1. when you updated the list of apps, the changes would be lost

  2. when you installed the app, there could be some changes

My advise: much simplier is to make customization right in the core. Although it is not a good idea as well, at least it would work in 100% cases


 

Avatar
Discard
Related Posts Replies Views Activity
3
Jul 23
24324
2
Jun 22
4583
2
Sep 21
3479
1
Nov 20
6783
2
Mar 19
4972