Odoo — Book

Below is an example of developing a , which allows users to toggle specific functionalities on or off within a custom module. Feature: Custom Configuration Toggle

Create a new Python file to inherit the res.config.settings model. This model is transient and requires special functions to save and retrieve data.

In Odoo, "Odoo Book" refers to a comprehensive learning resource, such as the Odoo 18 Development Book by Cybrosys Technologies. To "develop a feature" in this context typically means implementing a custom functionality within an Odoo module using the framework's core building blocks like Python for business logic and XML for views .

This feature adds a specific checkbox to the Odoo settings menu, allowing administrators to enable or disable a custom "Student Notification" service.

: Extending the name_search() function to allow finding records by fields other than name, such as a mobile number.

from odoo import models, api class StudentRecord(models.Model): _name = 'student.record' @api.model def create(self, vals): res = super(StudentRecord, self).create(vals) # Check the system parameter is_enabled = self.env['ir.config_parameter'].sudo().get_param('education_organization.enable_student_notifications') if is_enabled: self.send_notification_email(res) return res Use code with caution. Copied to clipboard Other Common Features for Development

: Adding communication logs and activity scheduling to any custom model.

from odoo import models, fields class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' enable_student_notifications = fields.Boolean( string="Enable Student Creation Emails", config_parameter='education_organization.enable_student_notifications' ) Use code with caution. Copied to clipboard

Below is an example of developing a , which allows users to toggle specific functionalities on or off within a custom module. Feature: Custom Configuration Toggle

Create a new Python file to inherit the res.config.settings model. This model is transient and requires special functions to save and retrieve data.

In Odoo, "Odoo Book" refers to a comprehensive learning resource, such as the Odoo 18 Development Book by Cybrosys Technologies. To "develop a feature" in this context typically means implementing a custom functionality within an Odoo module using the framework's core building blocks like Python for business logic and XML for views .

This feature adds a specific checkbox to the Odoo settings menu, allowing administrators to enable or disable a custom "Student Notification" service.

: Extending the name_search() function to allow finding records by fields other than name, such as a mobile number.

from odoo import models, api class StudentRecord(models.Model): _name = 'student.record' @api.model def create(self, vals): res = super(StudentRecord, self).create(vals) # Check the system parameter is_enabled = self.env['ir.config_parameter'].sudo().get_param('education_organization.enable_student_notifications') if is_enabled: self.send_notification_email(res) return res Use code with caution. Copied to clipboard Other Common Features for Development

: Adding communication logs and activity scheduling to any custom model.

from odoo import models, fields class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' enable_student_notifications = fields.Boolean( string="Enable Student Creation Emails", config_parameter='education_organization.enable_student_notifications' ) Use code with caution. Copied to clipboard