Odoo Method Keywords For Assista

Table of contents
- ⚙️ Odoo Create Method
- Automate data processing
- Ensure business rule compliance
- Streamline custom workflows
- ⚙️ Odoo Write Method
- ⚙️ Odoo Unlink Method
- ⚙️ Odoo Onchange Method
- ⚙️ Odoo Compute Method
- ⚙️ Odoo Constraints Method
- ⚙️ Odoo Search Method
- ⚙️ Odoo Default Get Method
- ⚙️ Odoo Action Method
- ⚙️ Odoo SQL Constraints
⚙️ Odoo Create Method
Used to override the create method in Odoo models, allowing custom logic during record creation.
🚀 What It Does
✅ Lets you:
Modify values before saving
Add logic or checks during creation
Perform actions after records are created
@api.model_create_multi |
💡 Why Use the Odoo Create Method?
Automate data processing
Ensure business rule compliance
Streamline custom workflows
⚙️ Odoo Write Method
Customizes the write method to apply logic during record updates.
🚀 What It Does
✅ Enables you to:
Add logic before or after updates
Perform validations during write operations
Implement auditing or custom workflows
def write(self, values): |
💡 Why Use the Odoo Write Method?
Track changes for auditing
Enforce business rules during updates
Automate custom update workflows
⚙️ Odoo Unlink Method
Overrides the unlink method to define custom behavior during record deletion.
🚀 What It Does
✅ Lets you:
Add logic before or after deleting records
Implement soft delete mechanisms
Prevent deletion under specific conditions
def unlink(self): |
💡 Why Use the Odoo Unlink Method?
Prevent accidental deletions
Log or audit deletions
Manage related records during delete operations
⚙️ Odoo Onchange Method
Adds dynamic behavior to forms by updating fields when dependent values change.
🚀 What It Does
✅ Enables you to:
Automatically update fields when other fields change
Add client-side validations
Improve form usability with dynamic interactions
@api.onchange('field_name') |
💡 Why Use the Odoo Onchange Method?
Enhance user experience with real-time updates
Guide users with dynamic field adjustments
Reduce input errors at the form level
⚙️ Odoo Compute Method
Dynamically calculates field values based on dependencies. Automatically triggers when dependent fields change.
🚀 What It Does
✅ Enables you to:
Compute field values dynamically
Link field values to other fields
Ensure data stays consistent without manual input
field_name = fields.FieldType( |
💡 Why Use the Odoo Compute Method?
Automate value updates based on other fields
Keep data synchronized without extra code
Improve accuracy and reduce redundant data entry
⚙️ Odoo Constraints Method
Adds model-level validations that are enforced during create and write operations.
🚀 What It Does
✅ Lets you:
Enforce business rules at the database level
Prevent invalid data from being saved
Validate related fields during create/update
@api.constrains('field_name') |
💡 Why Use the Odoo Constraints Method?
Ensure data integrity
Block invalid updates at the model level
Provide meaningful validation error messages
⚙️ Odoo Search Method
Implements custom search behavior for your model — ideal for name search or complex domain logic.
🚀 What It Does
✅ Enables you to:
Customize how records are searched
Implement multi-field search logic
Control search behavior for specific fields
@api.model |
💡 Why Use the Odoo Search Method?
Enhance user search experience
Support advanced lookup scenarios
Make multi-field or conditional search possible
⚙️ Odoo Default Get Method
Sets default values for fields when creating new records.
🚀 What It Does
✅ Lets you:
Pre-fill fields with default values
Customize defaults dynamically based on context
Simplify record creation for users
@api.model |
💡 Why Use the Odoo Default Get Method?
Improve user experience with smart defaults
Reduce manual data entry
Dynamically set defaults based on logic or context
⚙️ Odoo Action Method
Creates methods that return action dictionaries for opening views or triggering actions.
🚀 What It Does
✅ Enables you to:
Open specific views dynamically
Control domain filters and context
Trigger custom windows or wizards
def action_action_name(self): |
💡 Why Use the Odoo Action Method?
Open forms, lists, or wizards with custom logic
Pre-fill fields using context
Filter records dynamically when opening views
⚙️ Odoo SQL Constraints
Adds database-level constraints to ensure data integrity and enforce rules at the database level.
🚀 What It Does
✅ Lets you:
Prevent duplicate records
Enforce unique or custom SQL conditions
Ensure integrity directly in the database
sqlconstraints = [ |
💡 Why Use Odoo SQL Constraints?
Enforce rules beyond application logic
Catch data integrity issues at the database level
Improve reliability of your Odoo models
Subscribe to my newsletter
Read articles from Cybrosys Assista directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
