Extending standard Odoo apps with inheritance: what it does and when to use it
A business needs Odoo sales, inventory or accounting to behave differently from the standard app, and the decision is how to make that change. The two realistic routes are copying and editing core files, which creates a fork that must be merged by hand at every upgrade, or writing a custom module that extends the standard models, views and methods from the outside. The second route is almost always the one to choose. Odoo Community is licensed under LGPL-3.0, so you may read and extend its code, but the Enterprise source code is not publicly available and requires a subscription or partner access, which means any plan that depends on editing Enterprise files must start from the code you are actually entitled to see. Confirm your edition and access before you design anything.
Three mechanisms cover most changes. Model inheritance adds fields or methods to an existing model using _inherit on a new class, so the standard table gains your columns without a copy of the model. View inheritance uses inherit_id and XPath expressions to insert, move or hide elements in a standard form, list or report, so the change is anchored to the element it targets rather than to line numbers. Method overrides redefine a standard method and call super() to run the original logic first, keeping the core behavior and adding yours around it. Each of these is only as safe as its anchors: an XPath that targets a label string or a method that is rewritten instead of extended will break quietly when Odoo changes the source.
Inheritance is the right tool when the change touches business logic, needs version control and tests, or must survive several upgrades. Studio is quicker for simple fields and views inside one database, while a third-party Apps Store module fits when a vendor already maintains the same behavior for your version. Before choosing, ask the team who will port the code at each major release, and check the support window for your target version on Odoo's support documentation, since the port must finish before that window closes.
Which inheritance mechanism fits which change
This table matches the change types a sales, inventory or accounting team typically asks for with the mechanism that fits each one, the upgrade risk it carries and what to test. Read each row as a starting point: the right choice depends on how deep the change goes into standard logic. The main takeaway is that small, view-level or field-level changes carry the least porting work, while changes to core computation carry the most.
| Change type | Mechanism that usually fits | Upgrade risk | What to test |
|---|---|---|---|
| Add a field to a sales order or invoice form | View inheritance with XPath on the form, plus a field defined in a custom module | Low to moderate: XPath anchors can move or be renamed between versions | Form renders on each edit mode, field saves, appears on printed documents and in list views |
| Show a warehouse or lot field on a delivery line | View inheritance on the stock picking form and tree view | Low: view changes are usually small, but anchors in stock views change across releases | Picking validation, lot entry on barcode-driven moves, and access rights for warehouse users |
| Change how a sale price or discount is computed | Model inheritance with an overridden compute method that calls super | Moderate to high: the base method may change its logic or dependencies in a new version | Pricelist and discount cases, quotation to invoice flow, and multi-currency or multi-company orders |
| Block confirmation of an order under a condition | Override of the action method that calls super before or after the base logic | Moderate: the action may be split or renamed, and other modules may also override it | Confirmation with and without the condition, error message text, and interaction with other confirmation hooks |
| Post a journal entry with an extra line or tax treatment | Override of the posting method in account.move with careful use of super | High: accounting logic is sensitive and often reworked in major releases | Balances after posting, tax reports, reconciliation, and reversal behavior |
| Add a stock valuation or reordering rule change | Model inheritance on stock models with overridden methods, or a third-party module if the vendor maintains it | High: inventory valuation and replenishment depend on many interacting methods | Valuation after receipts and deliveries, returns, and replenishment runs on a copy of production data |
| Change a standard report or invoice layout | QWeb template inheritance on the report, or Studio for simple edits | Low to moderate: template IDs and structure may change between releases | Printed output on each paper format, headers and footers, and multi-language rendering |
| Buy a ready-made Apps Store module for the same need | Installing a third-party module that the vendor maintains for your version | Varies: depends on the vendor's support for each release and on conflicts with your own modules | Vendor's version support, install on a staging copy, and conflicts with each custom override you already have |
Building an inheritance-based change step by step
This sequence takes a requested change to a standard Odoo app from a scoping decision to a verified install, so the change lives in a small custom module that can be tested and ported at upgrade time. Each step ends with a check that tells you whether to continue.
Confirm edition, plan and version
Before writing code, confirm that your deployment can run custom modules at all. Per Odoo's pricing page, only the Custom plan can be hosted on Odoo.sh or on-premise and includes custom modules, so an Odoo Online Standard subscription will not accept this work. Next, confirm the exact Odoo version in production and the support window that applies to it, using Odoo's standard and extended support documentation, because that date sets how long the change must be maintained. Owner: the client's Odoo administrator with the implementation lead. Check: a written note listing edition, plan, hosting type, version and standard support end date, signed off by the client.
Check for an existing module or standard setting
Before building, search the standard app settings, the Odoo Community Association repositories for your exact version, and the Apps Store for a module that already covers the need. Many requests are met by a configuration option, a field that already exists, or a maintained OCA module, and each of those is cheaper to upgrade than new code. Record the result for each candidate: covers the need fully, partly, or not at all, and whether its license and maintenance status are acceptable. Owner: the functional consultant, with a developer reviewing the code. Check: a short decision record that explains why custom code is needed, or why it is not.
Create the module manifest and license
Create a new module folder with a
__manifest__.pyfile that declares the module name, version string for the target Odoo release, thedependslist of the standard apps you extend, and alicensekey chosen deliberately. Keep thedependslist minimal, since every extra dependency adds upgrade work. Add an empty__init__.pyand register the models and views files. Confirm the license choice with your legal or licensing reviewer, using the separate licensing guidance for LGPL, AGPL, OPL and OEEL modules. Check: the module installs in a clean development database without errors and appears in the Apps list with the declared license.Write the inherited model and view
Extend the standard model with
_inheriton a Python class, adding only the new fields and methods the change needs. Do not copy the original model's code. For the user interface, use view inheritance withinherit_idand an XPath expression that targets a stable element, preferably by field name or a uniquenameattribute, rather than by position in the layout. Keep each XPath expression narrow so a markup change in a later release breaks as few views as possible. Owner: the developer, reviewed by the functional consultant. Check: the new field appears on the expected form in the development database, and the standard form still opens without errors.Add super-based method overrides
Where behavior must change inside an existing method, override it with the same signature and call
super()so the standard logic still runs. Put your extra logic before or after the call deliberately, and avoid replacing the whole method body with copied code, since copies do not receive upstream fixes. Keep each override short and document what it adds, so an upgrade reviewer can see exactly where your behavior sits. Check: run the standard workflow that calls the method, such as confirming a sale order or validating a delivery, and confirm the standard result is still produced alongside your change.Install and test in a staging copy
Install the module in a staging copy of production, not in production. Odoo documents database duplication with neutralization for test copies, which keeps live data and outgoing email out of the test environment. Run the affected business flows end to end, including edge cases such as partial deliveries, multi-company records and archived records, and record the results. Add automated tests for the behavior you changed, using the TransactionCase and tour approaches described in the testing guidance, so later upgrades can be checked the same way. Owner: the QA lead and the developer. Check: a written test result with no blocking defects and a list of accepted known issues.
Verify on an upgraded test database before go-live
If the change must survive an upgrade, test it against a database copy that has been moved to the target Odoo version. Odoo's upgrade documentation describes an upgraded test database that should be tested before production, and the same rule applies to custom modules. Confirm that each inherited view and overridden method still matches the new standard code, and that the module installs without warnings. Record the upgrade test in the change log so the next team knows what was verified and on which version. Check: the module installs on the upgraded copy and the regression tests pass on it.
Deploy to production and document the change
Install the module in production using the same version, source and configuration that passed staging, then run a short smoke test of the changed flows with the business owner present. Document the module's purpose, the standard models and views it inherits, the license, the test suite location and the upgrade notes in the module's README and in your project records. Schedule a review of the change at each planned upgrade and at the end of standard support for the version. Check: the production smoke test passes, the documentation is stored with the code, and the upgrade review date is recorded.
Keeping inherited changes small enough to port
Every inherited change is a piece of code that must be ported when the next major Odoo version arrives. The practices below decide how much of that work is routine and how much becomes a rewrite. Each one limits what the custom code depends on, or makes that dependency visible before an upgrade starts.
Call super instead of copying methods
When a standard method needs a new rule, override it and call super() so the original logic runs unchanged. Copying the method body into a custom module freezes the old logic in place, so every bug fix and business rule added by Odoo in a later release silently stops applying to your database. At upgrade time, a copied method has to be compared line by line against the new source. Check every override for a copied body and ask whether the change could be written as a pre or post step around super().
Target stable XPath anchors
View inheritance with XPath depends on the element names and attributes in the standard template. Anchors tied to a field name or a stable group are more likely to survive a release than anchors based on position, such as the third <div> inside a page. When an XPath stops matching, Odoo may fail to load the view or quietly skip the change, which is hard to spot in testing. Keep anchors as specific as the purpose requires, and list every inherited view with its anchor so the upgrade team can check each one against the new template.
Keep one purpose per module
A module that adds a discount rule, a report column and an approval step is hard to port, because a failure in one part blocks the whole module from installing. Splitting custom code into small modules, each with one business purpose and its own manifest, lets the team port, test and retire them separately. It also shows which features can be dropped if the standard app now covers them. Review each module's manifest dependencies and confirm that no module depends on another only for a helper it could define itself.
Document every override
For each inherited model, method or view, record the target, the reason, the business owner and the standard version it was written against. Without this record, an upgrade team must reverse-engineer intent from the code, which is slow and error-prone. Keep the register in the same repository as the code and update it in the same change that adds the override. Ask the implementation partner for this register as a deliverable, and check that it lists Studio changes as well as code.
Record duplicated standard features
Custom code sometimes rebuilds something the standard app already does, such as a second approval flow or a custom stock status field. Each duplicate becomes a parallel feature that must be maintained and tested after every upgrade, and it can diverge from the standard behavior that reports and integrations rely on. Keep a list of every standard feature that was replaced or copied, with the reason it could not be configured instead. Review the list at each upgrade, because a standard feature added later may make the custom copy unnecessary.
Test the overrides on every upgrade
Porting is only complete when the overrides run against the new version with realistic data. Automated tests for each inherited method and view, run on module install, catch broken anchors and changed signatures before users see them. Use a database copy from production with personal data neutralized for the trial upgrade, and confirm that the sales, inventory and accounting flows touched by each override still produce the same results. Ask for the test list as part of the porting estimate, not as an afterthought.
Odoo on-premise docsHow upgrades affect inherited code and what sets the deadline
Every inherited view, overridden method and extended model has to survive the next major version, and the date that matters is the end of standard support for the version you run. Odoo standard support covers the first three years after a major release on Odoo Online, Odoo.sh and on-premise, including security updates and bug fixes. Odoo 17.0 standard support ended in September 2026, Odoo 18.0 runs until September 2027, and Odoo 19.0 runs until September 2028. Once the version you run falls out of standard support, security patches stop for it, so the upgrade deadline is set by that window and not by the date your own project started. Confirm the current end date for your version in Odoo's support documentation before you plan the port, because your customizations will need to be ported in the time left.
The path to a newer version depends on your hosting. On Odoo Online and Odoo.sh, major version upgrades are mandatory every two years, so custom code on those platforms is ported on Odoo's schedule rather than yours. On-premise Enterprise databases use Odoo's upgrade service, which builds an upgraded test database that you should test before anything reaches production. That test database is where inherited views and overrides show their breakage, so the first upgrade run is a finding exercise, not a formality. Community has no access to the upgrade service, so a Community deployment needs its own porting route and its own test plan. Ask any partner quoting the work which route applies to your edition and hosting, and who runs the upgraded test database.
Small, well-tested inheritance is what keeps the porting effort bounded. Each _inherit extension, xpath view change and super() override is a point where a new standard release can break your code, so keep a list of them per module, with the reason each exists and the test that proves it works. Ask for the list of inherited models, views and overridden methods as part of any upgrade estimate, and check that each entry has an automated test that runs after the upgrade. Plan a fixed window after each Odoo release for the port and the test pass, starting well before the standard support end date for your current version.
Security and access risks in custom inherited code
Every inherited model, view or method change runs with the same database and permissions as standard Odoo, so a small override can widen data access or skip a check the core code relies on. The cards below cover the places these risks usually enter: access rules, privileged calls, skipped checks and the module repository itself.
New fields outside record rules
Record rules and access rights are defined per model, so a field added by inheritance is readable wherever the model is readable, and a related or computed field can expose values from a model the user cannot open directly. Check each new field against the model's access rules and the records it can reach through many2one links. Confirm that sensitive fields are excluded from list views, exports, reports and API responses before the module ships.
Odoo upgrade docssudo calls that widen access
Calling sudo() inside an override runs the rest of that code as a superuser, which skips record rules and access rights for every record it touches. Developers often add it to fix a permission error in one button, then that method is called from portal, public or API paths they did not test. Review every sudo() call and document why it is needed, the exact records it reads and which user triggers it.
Overrides that skip standard checks
Overriding a method and returning early, or replacing its body instead of calling super(), can remove validation, state checks or security logic that the standard app depends on. The override may still pass its own tests while a confirmed order, posted invoice or closed period is changed in a path the core code would have blocked. Confirm that each override calls super() at the right point and that state guards still apply after it.
Access rights for new models
A new model added alongside an inherited app needs its own access control entries, or it falls back to the default behavior of the database. Models created without explicit rules can be readable or writable by groups that should see nothing, and the gap often appears only in a second company or a portal user session. Check the access rights file for each new model and test with a user from every relevant group.
Code review for module changes
Inherited code is easy to merge without a security reader, because the change looks small in a diff. Require review of each pull request for access rules, sudo() use, changed ir.rule or security groups, and any new controller routes or auth='public' endpoints. Record who reviewed each change and keep the review with the release, so auditors and the next developer can trace why a rule exists.
Secrets in the module repository
Custom modules often hold API keys, payment or bank credentials, and connection strings for integrations, and a committed file can leak them to every clone of the repository. Keep secrets in the Odoo configuration or a secrets manager, never in module data files or demo data, and scan commits for credentials before they reach a shared branch. Ask whether the repository history has ever contained a live key and rotate any key that has.
Questions buyers ask about extending Odoo with inheritance
What drives the cost of an Odoo inheritance project?
The cost is driven mainly by how many standard models, views and methods the change touches, how much business logic sits in those overrides, and how much testing and documentation the client expects. A change that adds one field to a form is far smaller than one that alters pricing, stock valuation or posting logic across several apps. Cost has two parts: one-time build and test work, and recurring work at each Odoo upgrade to port the code. Ask any partner for a written scope that lists each model and view affected, the test cases included, and the upgrade effort assumed for the next major version.
How long does a typical inheritance change take to build and test?
Duration depends on the number of touched extension points, the complexity of the business rule, and how many environments need validation before go-live. Simple view changes move quickly, while overrides of posting, pricing or stock logic need more analysis, edge-case testing and review against a staging copy of production data. Ask for a timeline that separates design, build, automated tests, user acceptance testing and deployment, and confirm which of those phases the quote includes. DeployOpen plans each engagement as a fixed scope agreed in writing before work starts.
What does the work need from our team?
Your team needs to name a process owner who can confirm the business rule, provide sample records and edge cases, and approve test results. Someone with access to a non-production database copy and your source repository is also needed, plus a way to review code changes before they reach production. Without those inputs, the build tends to stall on questions that only your staff can answer. Ask the partner to list these inputs in the scope so you can plan staff time before the project starts.
Can our own developers build inheritance changes without a partner?
Yes, if they know Python, the Odoo ORM and XML view inheritance, and if they can run automated tests and an upgrade test on a copy of the database. The main risk is not the first build but the maintenance: inherited methods must keep calling super correctly, XPath expressions must still match after upgrades, and the team must track every override. Developers new to Odoo often succeed with small view changes and struggle with overrides in accounting or inventory. Check the skills of your team against the change list before deciding.
How do inheritance changes affect Odoo upgrades?
Each inherited method or view is a dependency on the standard code, so an upstream change can break the extension during an upgrade. Keeping overrides small, documenting why each one exists, and writing tests for the behavior you depend on reduces the porting effort. Odoo's upgrade documentation describes an upgraded test database that should be tested before production, and on-premise use requires an Enterprise subscription. Major versions also carry support deadlines, so plan the next upgrade before you add more overrides.
When should we choose Studio or a third-party app instead of inheritance?
Choose Studio when the change is a field, view or simple automation that Studio can build and your edition supports it, since Studio is part of the Custom plan on Odoo's pricing page. Choose an Apps Store or OCA module when a maintained module already solves the same problem and its license and version support fit your environment. Use custom inheritance when the change needs logic that Studio cannot express and no maintained module covers it. Confirm the license, edition and upgrade support of each option before you decide, since those terms vary.
What should we ask for in a quote for this work?
Ask for a written list of every model, view and method to be extended, the acceptance criteria for each, and the automated tests delivered with the code. Request the target Odoo version, the edition you run, and how the code will be packaged and deployed. Also ask how upgrade porting is priced and whether it is in or out of scope. A quote that cannot name the extension points is not yet a scope.
How a custom inheritance module moves from build to upgrade
The path starts with a requirement and an edition check, because inheritance code only runs on a database whose edition and hosting allow custom modules. The module is then built and installed on a staging test database copy, where it is tested before production. The same module is later ported to the next supported version and retested on an upgraded test database before any production upgrade. Each hand-off is a point to check: edition, test coverage, and whether the module still matches the target version.
Stages a custom inheritance module passes through, from build to a version upgrade.
How DeployOpen scopes and delivers inheritance-based Odoo changes
DeployOpen starts every inheritance-based change with a written scope that names each override, the standard model or view it touches, the deliverables and the timeline, and both sides agree to it before any code is written. Most engagements are fixed-scope, so the list of inherited models (for example sale.order, stock.picking or account.move), the XPath anchors in each view extension, and the acceptance tests are fixed on paper first. Anything that is not on that list, such as a new report layout or a client-side change to the Owl web client, is quoted as a separate item. Ask for this list in any quote you receive, whether from DeployOpen or another partner, because it is the document you will measure the work against and the baseline for any later change request.
The build happens inside your own infrastructure, in the cloud accounts, data centers or air-gapped network you already run, so the custom module lives in your repository from its first commit. Each override is tested on a copy of your production database, not on a clean demo database, because inherited behavior depends on your data, your installed modules and your existing records. DeployOpen documents every override in the module itself: the model or view it extends, the reason, the methods that call super(), and the version it was built against. That documentation is what your team, or the next partner, will need when the Odoo upgrade path is planned. Confirm with DeployOpen who owns the repository, the test database and the documentation at handover, and make sure it is written into the scope.
After go-live, the changes need someone to port them to each new major version, and that work recurs. DeployOpen offers optional retainers for upgrades and continuous testing, which you can add to the fixed-scope build or buy later. Ask what a retainer covers in writing: which versions are included, whether the test suite runs on each upgraded test database, and how urgent fixes are handled. The cost of porting grows with the number of overrides and with how far each one reaches into standard logic, so keep the scope small and ask for the count of overrides as a line item. Check the support windows in the Odoo standard and extended support documentation before you set the retainer term, because they determine how long a version stays patched.

