官术网_书友最值得收藏!

Modifying and extending modules

In the example that will follow, we will create a new module with as few dependencies as possible.

This will not be the typical case, however. The most frequent situation is where modifications or extensions are needed on an already existing module to fit some specific use cases.

The golden rule is that we shouldn't modify existing modules by changing them directly. It's considered bad practice to modify existing modules. This is especially true for the official modules provided by Odoo. Doing so does not allow a clear separation between the original module code and our modifications, and makes it difficult to apply upgrades.

Instead, we should create new modules to be applied on top of the modules we want to modify, and implement those changes. This is one of Odoo's main strengths: it provides "inheritance" mechanisms that allow custom modules to extend existing modules, either official or from the community. The inheritance is possible at all levels data models, business logic, and user interface layers.

Right now, we will create a completely new module, without extending any existing module, to focus on the different parts and steps involved in module creation. We will just take a brief look at each part, since each will be studied in more detail in the later chapters. Once we are comfortable with creating a new module, we can dive into the inheritance mechanisms, which will be introduced in the next chapter.

主站蜘蛛池模板: 双流县| 南漳县| 宜兴市| 通许县| 观塘区| 晋城| 桂东县| 咸宁市| 安岳县| 黔东| 蚌埠市| 莱阳市| 西安市| 凤山县| 梓潼县| 漳州市| 大洼县| 皋兰县| 体育| 高邮市| 奉贤区| 德安县| 西丰县| 精河县| 彰化市| 浏阳市| 通河县| 正蓝旗| 通海县| 普宁市| 临高县| 紫金县| 长子县| 仁怀市| 抚远县| 浠水县| 淮南市| 北碚区| 三门县| 八宿县| 福贡县|