Odoo Updates · Odoo 20

Odoo 20 for developers: what changes in custom modules

A deep dive for the people who maintain custom modules and integrations: what changed between 19.0 and 20 in access rights, binary fields, report models, website context and the external API, which features your code may depend on are gone, and a five-step plan to move a module across.

By Octagotech Team11 min read

Key takeaways

  • ACL files and record rules give way to one ir.access model, so every module's security files need converting.
  • Binary fields return a BinaryValue, and attachments silently ignore the removed datas field.
  • Model._table_query is gone, and the standard analysis reports were rebuilt around new hooks.
  • Tracking values, work entries, Field Service, flexible consumption and the return wizard were removed or moved.
  • Odoo 20 needs Python 3.12 and PostgreSQL 16, and integrations should move to JSON-2 before Odoo 22.

Our Odoo 20 overview covered the developer changes in one paragraph. This deep dive is for the people who keep custom modules and integrations running. We worked from Odoo's 20.0 ORM changelog, the external API and upgrade documentation, the release notes and the odoo/odoo 20.0 source as of September 30, 2026, and each code sample mirrors a pattern in that source. Enterprise apps such as Planning are not in the public repository, so for those we rely on the release notes.

One thing first. The changelog files many of these changes under Odoo Online versions 19.1 to 19.4, which a 19.0 database on Odoo.sh or your own server never ran. A jump from 19.0 to 20 crosses all of them at once. For the steps from 16 to 19, see our guide to custom modules from 16 to 19.

Access rights: ir.access replaces ACLs and record rules

The release notes say access rights were simplified by removing record rules and putting a domain on the access right itself. The changelog dates the new ir.access model to 19.4, and in the 20.0 source neither ir.model.access nor ir.rule exists any more. Each ir.access record names a model, a set of operations written as letters (such as cru for create, read and update), an optional domain and an optional group. With a group, it grants those operations on matching records to the group's users. Without one, it restricts them for everyone, and restrictions win: the allowed records are those matching any permission and every restriction.

For a module that shipped record rules, this is not optional. Odoo's data loader takes the model name from a CSV file's name, so an ir.model.access.csv file no longer loads, and an XML record for ir.rule fails too. An ACL row and its rule usually collapse into one line:

Odoo 19

# security/ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_route_trip_user,route.trip user,model_route_trip,base.group_user,1,1,1,0

<!-- security/route_security.xml -->
<record id="route_trip_own_rule" model="ir.rule">
    <field name="name">Own trips only</field>
    <field name="model_id" ref="model_route_trip"/>
    <field name="domain_force">[('user_id', '=', user.id)]</field>
    <field name="groups" eval="[(4, ref('base.group_user'))]"/>
</record>

Odoo 20

# security/ir.access.csv
id,name,model_id,group_id/id,operation,domain
access_route_trip_user,route.trip own trips,route.trip,base.group_user,cru,"[('user_id', '=', user.id)]"

The 20.0 source ships a converter for this, the 19.4-00-ir-access script in odoo/upgrade_code, which writes ir.access.csv files and updates the manifest. It logs warnings for cases to check by hand and errors for cases it cannot handle, so read the log. Then re-test by role, because a user in several groups now gets the union of their permissions cut down by every restriction, and a set that looks equivalent can grant a little more or less than before.

Python overrides move too. Overriding _check_access is deprecated since 20.0 in favor of _access_domain(operation), which returns a domain. Since 19.3 there is also an access domain operator, as in ('channel_id', 'access', 'read'), which lets a record follow the access of a linked record; the 20.0 mail module uses it.

Binary fields return a BinaryValue

Per the changelog, binary fields stopped carrying base64 through the ORM over three steps: raw storage in 19.2, a BinaryValue type in 19.3, and a file name plus a new API format in 20.0. In the 20.0 source, reading a binary field gives an object with .content (bytes), .size, .mimetype, .filename, .to_base64() and .open(), and an empty value is falsy. Writing a base64 string still works, because the ORM assumes it came from an API call. Writing raw bytes raises a TypeError, except on an attachment's raw field; wrap them in BinaryBytes from odoo.tools.

The trap is ir.attachment.datas, which is removed. When 20.0 creates an attachment with datas, it logs a warning and drops the value, so you get an attachment with no content and no error. Switch every such call to raw, which already exists in 19, so the fix can ship before the upgrade.

Odoo 19

self.env['ir.attachment'].create({
    'name': 'packing-list.pdf',
    'datas': base64.b64encode(pdf_bytes),
    'res_model': 'stock.picking',
    'res_id': picking.id,
})
record.signature = base64.b64encode(png_bytes)
png = base64.b64decode(record.signature)

Odoo 20

from odoo.tools import BinaryBytes

self.env['ir.attachment'].create({
    'name': 'packing-list.pdf',
    'raw': pdf_bytes,
    'res_model': 'stock.picking',
    'res_id': picking.id,
})
record.signature = BinaryBytes(png_bytes)
png = record.signature.content

Integrations feel this too. Through the API, reading a binary field in 20.0 returns an object holding the base64 content, the size and, when set, the file name, rather than a bare base64 string.

Model._table_query is removed

The 20.0 changelog lists the removal of Model._table_query. SQL-backed models, mostly reports, now override the _table_sql property and return an SQL object for the subquery, parentheses included, as the standard reports do. Reports built with CREATE VIEW in init() are unaffected.

The bigger knock-on is that Odoo rewrote its own analysis reports on the new pattern. In 20.0, sale.report no longer has _select_additional_fields, _group_by_sale or _query; it builds its query from _select_dict(table) and _groupby_list(table), using field paths instead of SQL aliases. Adding a column to Sales Analysis is one of the most common customizations there is, and Odoo's own sale_stock module shows the change:

Odoo 19

def _select_additional_fields(self):
    res = super()._select_additional_fields()
    res['warehouse_id'] = "s.warehouse_id"
    return res

def _group_by_sale(self):
    res = super()._group_by_sale()
    res += """,
        s.warehouse_id"""
    return res

Odoo 20

def _select_dict(self, table):
    return super()._select_dict(table) | {'warehouse_id': table.order_id.warehouse_id}

The pull request that removed _table_query also touched the purchase, invoicing, POS, CRM, project and timesheet reports, among others, so check every module that inherits a standard report.

env.website replaces request.website

The changelog records the removal of request from model code and the arrival of env.website in 19.4. In the 20.0 source, env.website is the website named by website_id in the context, or an empty recordset. The get_current_website() method is gone, and website routing no longer sets request.website.

# Odoo 19
website = request.website
website = self.env['website'].get_current_website()

# Odoo 20
website = self.env.website  # empty when no website is in the context
orders = orders.with_context(website_id=website_id)  # crons and scripts

This bites where there is no web request: scheduled actions, scripts, tests and server actions. Code that relied on the old fallback to a default website now gets an empty recordset, so pass website_id explicitly and test those jobs.

The web client moves to OWL 3

This one is not in the ORM changelog, but it is in the 20.0 source. The web client now bundles OWL 3, whose version string still carries an alpha label, where 19.0 shipped OWL 2.8. Odoo loads an OWL 2 compatibility layer so older components keep running, and its notes list the changes they still need, such as renaming t-model to t-custom-model and useEffect to useLayoutEffect. The upgrade_code folder includes an owl3-migration script for this. Run it, then open every custom widget, client action and POS screen, and remember that Odoo describes the layer as temporary.

Removed features your code may depend on

Five removals in the release notes reach into custom code. For each, here is what the 20.0 source shows and what a module must do.

Stored tracking values

The notes say tracking values were removed and the tracking message is generated on the fly, with a dedicated module for admins who still need the values. In the source, mail.tracking.value and the message's tracking_value_ids moved out of mail into a new mail_tracking module. Code that reads tracking values, such as stage-duration reports or audit exports, must depend on that module or read the messages instead.

Work entries and time off types

The notes say work entries and the Planning and Payroll integration were removed, and that work entry types and time off types were merged. The 20.0 source has no hr.work.entry or hr.leave.type model, and a time off request points to work_entry_type_id where 19 used holiday_status_id. Rewrite every reference in code, views, reports and saved filters, and map custom fields on old leave types in a migration script.

Field Service, now inside Planning

The notes say the Field Service app was discontinued and its features moved into Planning. Both are Enterprise, so the public source cannot show the details. A module that depends on Field Service needs rebasing on Planning, and worksheets, reports and Studio fields on old field service tasks need checking on an upgraded test database. Our operations deep dive covers the user side.

Flexible consumption

The notes say the flexible consumption setting was removed and every manufacturing order consumes flexibly. In the source, the consumption field is gone from both mrp.bom and mrp.production, while differences are still summarized at closing. Remove reads and writes of that field, and if your process relied on blocking, rebuild that control in your own code.

The return wizard

The notes say the return wizard was removed and returns simplified. In the source, stock.return.picking and its line model are gone, and the picking creates its own return. Code that drove or inherited the wizard moves to the picking's methods, such as _prepare_return_move_default_values:

# Odoo 19
wizard = self.env['stock.return.picking'].with_context(
    active_id=picking.id, active_model='stock.picking').create({})
wizard.action_create_returns_all()

# Odoo 20
return_picking = picking._create_return()
return_picking.action_return_all()

External integrations: JSON-2 and three-month keys

Odoo's external API documentation marks the XML-RPC and JSON-RPC endpoints as deprecated. Their db service, which creates, copies and drops databases, was removed in Odoo 20. The common and object services, which most integrations use, are scheduled for removal in Odoo 22, in fall 2028. Build anything new on the JSON-2 API that arrived in 19, and move the rest while you are already testing.

# XML-RPC object service: removal scheduled for Odoo 22
models = ServerProxy(f"{url}/xmlrpc/2/object")
partners = models.execute_kw(db, uid, password, 'res.partner', 'search_read',
                             [[['is_company', '=', True]]], {'fields': ['name']})

# JSON-2: model and method in the URL, named arguments, API key
partners = requests.post(
    f"{url}/json/2/res.partner/search_read",
    headers={"Authorization": f"bearer {api_key}"},
    json={"domain": [["is_company", "=", True]], "fields": ["name"]},
).json()

Plan for keys. The same documentation says no API key can last more than three months, so every integration needs a rotation routine and an owner. It also says data access through the external API needs a Custom plan. And the binary changes above apply over the API, so check any integration that sends or reads files.

Server requirements for Odoo 20

Odoo's 20.0 installation guide raises the minimums to Python 3.12, from 3.10, and PostgreSQL 16, from 13, and the 20.0 source sets the same values. Self-hosted databases that use AI features also need the pgvector extension. On Odoo.sh or your own server, build a new environment and treat the PostgreSQL major upgrade as its own tested step; on Odoo Online, Odoo runs the server.

Odoo 19 vs Odoo 20: what changed and what to do

Odoo 19Odoo 20What to do in your module
ir.model.access.csv and ir.rule recordsir.access with a domainConvert, then re-test by role
_check_access overrides_access_domainMove the logic into a domain
Binary fields as base64BinaryValueRead .content, write BinaryBytes
ir.attachment.datasRemoved, ignored on createWrite raw
_table_query_table_sqlOverride the property
sale.report SQL hooks_select_dict, _groupby_listRewrite report extensions
request.websiteenv.websitePass website_id off-request
OWL 2.8OWL 3 with a compatibility layerRun the OWL 3 script, test widgets
Tracking values in mailmail_tracking moduleDepend on it, or read messages
hr.leave.type, work entriesWork entry typesRewrite references, migrate data
Return wizardReturns on the pickingCall the picking's methods
BOM consumption settingRemovedDrop it, rebuild any blocking
XML-RPC db serviceRemovedUse JSON-2
Python 3.10, PostgreSQL 13Python 3.12, PostgreSQL 16Build a new server

A five-step plan to take a 19 module to 20

The sequence matches our 16 to 19 plan and the stages of our Odoo upgrade and migration method: each step has exit criteria that are met before the next one starts.

  1. Inventory every module and integration. Flag anything that touches security files, binary fields or attachments, report models, website context, tracking values, time off, field service, MRP consumption, returns or custom JavaScript, and list every integration still on XML-RPC or JSON-RPC. Mark each one keep, replace with standard, or retire.
  2. Build the server and run the converters. Set up Python 3.12 and PostgreSQL 16, then run Odoo's upgrade_code command on a branch: the 19.x scripts with --from, and the OWL script with --script owl3-migration, each with --dry-run first. The command's own notes call the scripts a best effort, so review every change.
  3. Make each module install on an empty 20 database. Odoo's guide to upgrading a customized database recommends this step. Run with tests on, fix what the log reports, then rewrite by hand what no script covers: attachments, report extensions, returns, time off and website context.
  4. Test an upgraded copy, by role. Request an upgraded test database. On September 30, Odoo's upgrade platform still offered 17.0 to 19.0 as targets, not 20.0. For Community, the OCA's OpenUpgrade opened its 20.0 branch on September 28, so coverage will take time; check its coverage tables before relying on it. Test what each role can see, every report and every integration.
  5. Rehearse the data move twice, then cut over. Write migration scripts for data the removals touch, reconcile record counts, and time each run. Run the upgraded system beside live, and cut over in a quiet window.

When to move. For most databases, land on 19 first and move to 20 once the first rounds of fixes are in, unless a version 20 feature is critical to you. On Odoo Online, per Odoo's upgrade documentation, major versions must upgrade every two years, and minor online versions (such as 19.1 to 19.4) a few weeks after the next version is released. If your Odoo Online database runs a 19.x online version, start testing now. If agents are part of your plan, our AI agents deep dive covers the tools they call, and our customization and integration team builds them upgrade-safe.

Frequently asked questions

Are record rules removed in Odoo 20?

Yes. Odoo 20 replaces ir.model.access and ir.rule with one model, ir.access: a permission (with a group) or a restriction (without one) on some operations, limited by a domain. Modules ship security/ir.access.csv instead, and Odoo's upgrade_code command can convert the old files as a first pass.

What is BinaryValue in Odoo 20?

It is what a binary field returns. Instead of base64 text, you get an object with the raw content, size, mimetype and file name. Writing raw bytes raises an error unless you wrap them in BinaryBytes, and attachments now ignore the removed datas field, so write raw instead.

Do XML-RPC integrations still work with Odoo 20?

Mostly, for now. Odoo 20 removed the db service, and the common and object services are scheduled for removal in Odoo 22, in fall 2028. Move integrations to the JSON-2 API that arrived in 19, and plan to rotate API keys at least every three months.

What Python and PostgreSQL versions does Odoo 20 need?

Odoo's 20.0 installation guide requires Python 3.12 or later and PostgreSQL 16 or later, up from Python 3.10 and PostgreSQL 13 for Odoo 19. Self-hosted databases that use AI features also need the pgvector extension.

Octagotech Team

Certified Odoo Ready partner · San Francisco, New York, Ahmedabad and Rajkot

Our engineering team in Ahmedabad audits and rewrites custom modules for each new Odoo release, for upgrades from any Odoo version, and every rewritten module comes back with tests and a migrations folder. About Octagotech, Odoo Ready partner.

Custom modules on 19?

Bring your module list and integrations, and in 30 minutes we will tell you what the move to 20 touches.

Book a discovery call

Find out what Odoo 20 means for your custom code

The first call takes 30 minutes.

Or email sales@octagotech.com