Create Custom Module Odoo

For modifying the exists or just creating a whole new one

Photo by Oliver Hae on Unsplash

Odoo Structure

First, I learn about structure of an Odoo module. Here’s the summary.

  • views/ contains XML templates.
  • data/ contains sequence setting and XML files except template.
  • models/ contains Python file where the logic written with init file inside.
  • security/ to manage modify access permission to read, write, create, and unlink.
  • static/ contains web assets, separated into css/, js/, img/, and other static file.
  • __init__.py contains import python package.
  • __manifest__.py contains module description, depends, import data XML, and other module configurations.

Create A New Custom Module

A new modul created to be customized based of my needs. So I can completely created new one without depend on existing module. Or I can take advantage of existing modules by inherit them to modify it. And how to create this is so easy.

Miniumum Requirements

The minimum requirement to create new module are:

  • 1 python package (contains 1 init file),
  • 1 manifest.

The further details are:

  1. Inside custom-addons directory, I created python package named school.
  2. Inside school, I create __manifest__.py with this minimum content:
{'name': 'School'}

In fact, there are a lot of informations that have to be set in manifest file, but for now I only write that single line.

View New Created Module In Odoo

  1. Start odoo service with PyCharm (for ease) and go to Setting menu, click Activate the developer mode that can be found on the right bottom screen.
  2. Go to Apps menu, click Update Apps List > Update.
  3. The last, type ‘school’ in Search Bar. And the module will show like a picture below.

Next

You can install that module but it will not make any differences because there are no single models and view file inside school directory (Of course!). So, in the next story, I will guide you how to do that.

Private Odoo Consultant. Reach me on linkedin.com/in/amirulm

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

01 — How does the Internet work

One Rest API for your Lifetime Salesforce Implementation with Flow Builder as Controller

Does Java only pass by value?

READ/DOWNLOAD@] Modern Graphics Communications FULL BOOK PDF & FULL AUDIOBOOK

You just read another post from In Fitness And In Health: a health and fitness community

Xylophone Flutter app for beginners

Piloted Highway Driving

Introducing G|Code’s Change Makers: Sagal Alisalad

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amirul M.

Amirul M.

Private Odoo Consultant. Reach me on linkedin.com/in/amirulm

More from Medium

Using the Youtube API to get live viewer count

Docker -> How to fix failed to solve with frontend dockerfile.v0 error when building a docker image

Git Feature — A new methodology to manage your development work