Search code examples
odooodoo-14

How to modify files and folders structure of scaffold command?


I find myself use command scaffold to generate a template for a new module. However, as I use it a lot, I need to tediously delete some files or some codes in order to make it into a structure I like most of the time. For example, I always delete control and demo folders, change some codes in init and manifest files, and add icon.

Is there any way I can do the modification and save it into the scaffold command so that every time I call it, it will generate according to my modification?


Solution

  • You can use scaffold -t or scaffold --template with your original source module name.

    For example, build your template module and delete folders that you don't want to generate from scaffold.

    Afterwards, pass that template module name when you generate a new scaffold module.

    scaffold -t template_module new_customer_module_name destination_module_path

    OR

    scaffold --template template_module new_customer_module_name destination_module_path