Odoo developer interview questions become practical when an answer preserves three things together: the records a method receives, the caller's authority over them, and the persistent data affected by a module change. A form that works for an administrator does not establish that an ordinary user is authorized, that a multi-record action works, or that an existing database upgrades correctly.
This guide uses Odoo 19.0 developer documentation and original reasoning exercises. Begin with PracHub's Design an access control system (RBAC + resource-based) to practice stating the operation, actor and resource before evaluating permission. The prompts are transferable practice material, not predictions of an Odoo employer interview.
Verification boundary: An eight-case Python policy model was executed locally. It illustrates Boolean composition only; it is not Odoo's security implementation. No Odoo server, PostgreSQL database, module installation, RPC call or upgrade was executed. Official framework facts are attributed below, and proposed integration tests remain proposals.
What is a recordset, and when should a method require one record?
Official ORM contract: The Odoo 19.0 ORM reference describes recordsets as collections of model records, with a single record represented by a recordset of one. ensure_one() checks cardinality. It does not establish that the caller is authorized to perform a business action.
Start by asking whether the method is a batch operation or an intentionally single-record action. An export, bulk state change or computed result may reasonably receive several records. A detail-oriented operation may require exactly one. Adding ensure_one() merely to remove an error can disable a valid batch use case instead of correcting the implementation.
For a proposed approval method, write down four inputs: an empty set, one eligible record, several eligible records, and a mixed set containing an ineligible record. Decide whether mixed input is rejected as a unit or handled through a defined per-record policy. That business decision should be explicit before changing iteration or exception handling.
Do not confuse a recordset's immutability with immutable business records. Returning a new recordset and writing fields on its members are different operations. Also avoid treating supplied IDs as proof of existence or permission: trace where IDs came from, how missing records are handled and where the requested operation is checked.
Why is a working administrator form weak access evidence?
Official security model: Odoo's security reference separates model-level access rights from record rules. ACL grants are additive. Applicable global record rules intersect; applicable group rules combine as alternatives, within the global boundary. When ACLs grant the operation and no record rule applies, the record-rule layer permits it.
This composition matters because “I added a restrictive rule” is an incomplete explanation. A second applicable group rule may expand the set admitted by the group layer. A second global rule narrows the global set. The same domain expression can have different effects depending on which kind of rule contains it.
For an interview, state the user, operation, group membership, applicable rules and company context. Check an ordinary user rather than relying on a superuser session. A visible menu, hidden button or filtered list is an interface observation, not a complete authorization test.
The order of explanation should follow the requested action. First establish that the model operation is granted. Then determine the applicable record restrictions. Then check field and business-action requirements. Treating every denied action as a missing ACL can lead you to grant broader model access when the real issue is an intentionally restrictive record rule.
How can you trace global and group rules without guessing?
Consider an original model for a read operation. All four records exist, the user is number seven, and an ACL grants read access. One global rule permits company A. The first group rule permits records owned by user seven. A proposed second group rule permits records in state done.
| Record | Company | Owner | State | Owner rule only | Owner OR done group rules |
|---|---|---|---|---|---|
| 1 | A | 7 | draft | Allow | Allow |
| 2 | A | 8 | done | Deny | Allow |
| 3 | A | 8 | draft | Deny | Deny |
| 4 | B | 7 | done | Deny | Deny |
Adding the second group rule admits record two. It does not admit record four because the global company boundary still fails. This is an intentionally small policy fixture, not a configuration to paste into a production module. Real rules also depend on the model, operation and actual user's groups.
The executed Python core is:
def allows(acl, global_results, group_results):
return acl and all(global_results) and (not group_results or any(group_results))
The full fixture evaluates each row and runs eight assertions. It checks the two visible sets, ACL denial, absence of applicable group rules, failure of one global condition, failure of all group conditions, and empty-rule cases. The results are [1] before the second group rule and [1, 2] afterward.
A useful follow-up changes one fact at a time. Remove the ACL grant and neither matching group rule grants model access. Remove all applicable group rules while retaining the company rule and the group layer no longer narrows that company's records. Explain why an empty applicable-rule set differs from two applicable rules that both evaluate false.
What should you say about sudo and public methods?
The official ORM reference states that sudo() changes superuser mode without changing the current user and can cross record-rule boundaries. It is therefore not evidence that ordinary permissions were repaired. Describe the minimal operation that needs elevated access, why that elevation is justified and how its input scope is established.
Suppose an action receives record identifiers from a caller and succeeds only after the developer applies sudo() to the whole search. The first question is whether the caller should be able to choose that entire set. An elevated write can turn an overly broad selection into a cross-company modification. Passing a normal-user test requires more than observing that the administrator action stopped raising an error.
Official API caution: The security documentation also warns that public methods can be invoked through RPC with caller-selected parameters; CRUD checks do not automatically validate every business transition. This is why hiding an approval button does not establish that a direct action request is safe.
For the original approval exercise, test a request for an already completed record, an unauthorized company and a record the user cannot write. Specify the intended result for each before implementing the action. Test with the actual caller environment in a sandbox. The local Boolean fixture does not exercise public-method invocation, Odoo field restrictions or elevation.
How would you diagnose a singleton or repeated-query problem?
First reproduce the method with the smallest input that fails. If one record works and two fail, inspect which expression assumes one member and whether the business action should be batch-capable. An iteration can be appropriate, but it should not silently change an all-or-nothing operation into partial progress.
For repeated queries, inspect the scope of the recordset used by the method and the operations performed inside the loop. Odoo's ORM documentation describes caching and prefetching; the practical lesson is to measure the actual query behavior rather than infer it from the number of Python field accesses.
Keep correctness and performance tests separate. A faster implementation that omits a record rule, fails to recompute a dependent field or alters the selected record set is not a valid optimization. Use a fixed input set, expected output and ordinary-user context while comparing query counts and elapsed time.
If direct SQL is proposed, identify the ORM behavior that would be bypassed and the reason it is necessary. Parameterized SQL addresses a query-construction concern, but it does not recreate ORM authorization or business behavior. Prefer the supported ORM operation when it expresses the required change, and treat any exception as a separately reviewed design choice.
Which artifacts change when an Odoo module changes?
Official module contract: The module manifest reference describes dependencies and module data files. The data-file reference explains sequential loading, external identifiers and noupdate behavior. These connect source files to persistent records; changing a Python file is only one part of a module change.
Use a change ledger before proposing a deployment. For each change, identify the existing data, intended new state and evidence that the update preserved the required behavior. A new field definition, a changed rule record and an edited default value create different questions.
| Proposed change | Existing-state question | Verification to request |
|---|---|---|
| Add a stored business field | What value should existing records receive? | Compare an existing-database upgrade with a fresh install. |
| Tighten a record rule | Which users and records currently rely on the broader access? | Repeat positive and negative actor/operation cases. |
| Change a data record's XML value | Is the record marked noupdate, and has an administrator edited it? |
Read the actual persistent value after the supported update path. |
| Rename an external identifier | Which other records refer to the old identity? | Check references and migration behavior rather than creating a second logical record. |
This ledger is an original planning asset. It is not a claim that a restart, a version edit or a module update automatically performs each listed migration. Require a specific supported mechanism and test result for the actual installed release.
Why can an XML change leave a database value unchanged?
The data-file documentation distinguishes records reloaded during updates from data intended to be loaded once through noupdate. Consequently, a changed XML value and an unchanged database value can be compatible with the declared loading policy. Inspect the record's external identity and flags before concluding that the file was ignored.
Consider a default approval threshold installed as protected module data. An administrator later changes it to fit local operations. A new source file contains another value. The question is whether the update should preserve the administrator's choice or deliberately migrate it. That is a product decision, not a reason to override protected data indiscriminately.
Keep this example scoped: “protected module data” here describes the loading policy, not an authorization guarantee for the record. A record can be excluded from routine update reloading while still requiring ordinary access controls. The two meanings should not be conflated.
Write the expected before-and-after values for a fresh database and an existing database separately. Include a customized record in the upgrade test. Otherwise, an installation test may pass while the real upgrade either fails to introduce the intended default or overwrites a supported local configuration.
What evidence would make a module upgrade convincing?
Official upgrade mechanism: Odoo's upgrade-script reference documents module migration scripts and pre, post and end phases. Use the release's supported version and naming rules; do not assume that putting a Python file anywhere in the module makes it execute during an update.
For preparation, describe a disposable test database containing representative existing records and customization. Record the starting module version and values, apply the planned update through the supported environment, then inspect data, rules, views and business operations as ordinary users. Preserve the error and rollback evidence if the update fails.
An install-only test misses changes that depend on existing rows. An administrator-only test misses permission regressions. A successful migration log misses incorrect business values. Your acceptance packet should therefore combine the upgrade result with selected data assertions and the same positive and negative access cases used before the change.
No such Odoo upgrade was executed for this guide. The tested policy function is useful preparation for specifying expected results; it cannot validate database migration phases, ORM cache behavior or the real framework's access implementation.
Five practice prompts for Odoo developer reasoning
These verified PracHub questions train adjacent reasoning. In particular, an ordered-rule exercise has its own semantics; do not transfer its first-match behavior into Odoo's global/group composition.
| Complete PracHub question | Odoo preparation extension |
|---|---|
| Evaluate Ordered Access-Control Rules | Contrast ordered evaluation with Odoo's rule composition. |
| Design an access control system (RBAC + resource-based) | Name actor, operation and record constraints explicitly. |
| Implement an Idempotent Versioned Database Update | Explain durable identity and repeated-change behavior. |
| Design authorization and audit logging systems | Distinguish authorization decisions from audit evidence. |
| Explain ETL schema changes and ensure integrity | Plan existing-data validation after a schema change. |
Recreate the four-record permission table, then add one module change to the ledger. Explain which ordinary-user and existing-database tests would establish the intended result before presenting the change as complete.
Sources and Further Reading
- Odoo 19.0: ORM API
- Odoo 19.0: Security in Odoo
- Odoo 19.0: Module manifests
- Odoo 19.0: Data files
- Odoo 19.0: Upgrade scripts
Official documentation and eight-case Python model checked November 20, 2026. No Odoo runtime or module upgrade was tested.


Top comments (0)