Default Values in Context and Potential Issues When passing a default value for a field via context , you need to consider that this value can be passed on to models initially not planned for. For example, when passing the product_qty as a defa... Odoo 17 Technical Dec 5, 2024
Default value issues caused by "onchange" method A default value for a field may not be set on the creation of a new record, even provided in the field definition In many cases, the reason for that is an onchange method that is resetting the value... Technical Dec 5, 2024
How to store in a field different values per company In multi-company mode, there are cases when one field would need to store different values for each company. An example of such fields are some of the accounting settings per product, such as Income A... Technical May 7, 2024 Tutorials
Optimize "create" overrides by using the decorator "model_create_multi" In some cases, there is a need to override the create method in Odoo and add additional logic to it. When overriding this method, the custom logic is triggered on each iteration of creating a new ob... Technical Mar 26, 2024
How to add a background color on tags using many2many_tags widget When using many2many_tags widget, it is possible to define a background color for each of the tag values. For that to work the following steps need to be done: The related model needs to have an Int... Technical Mar 18, 2024 Tutorials
How to change the text color for a column in a list view In Odoo it is possible to change the color or text style of a column in a list view using the “decoration” attributes. The syntax for them is decoration-<style> where the style can be one of the fol... Technical Mar 11, 2024
How to format dates in email templates When using a date field in the email templates it is important to use it with formatting function for the value to be represented in the format set in the language settings. The function for formattin... Functional Technical Feb 19, 2024
How to customize field definitions by group in Odoo view In everyday business cases, there are a lot of situations where a particular field needs to have different attributes or attribute values based on different access groups. This type of case is possibl... Technical Feb 12, 2024
How to hide a column in a list view A column in a list view can be hidden by using the attributes column_invisible or optional . The column_invisible attribute accepts a boolean value as True/False or 1/0 . Since this attribute ... Technical Jan 22, 2024
Methods for searching and filtering records in Odoo In Odoo can be found multiple different methods for filtering and searching records. Each of them is designed with their own uniqueness which makes it more useful in certain cases than others, even th... Technical Jan 1, 2024 Tutorials
How to update Many2many and One2many fields in Odoo Many2many and One2many fields in Odoo require a specific syntax for manipulating related data. The instructions mainly consist of 3 elements added in a tuple, where each of the elements has a special ... Technical Dec 11, 2023 Tutorials
How to change the priority of an existing view In the post The importance of correctly setting priority on inherited views we have already discussed the importance of the priority field in the inherited views and why it needs to have the right v... Technical Dec 4, 2023