Enable Dark Mode!
what-are-user-defined-defaults-in-odoo-19.jpg
By: Swaraj R

What are User-defined Defaults in Odoo 19

Technical Odoo 19 Odoo Enterprises Odoo Community

Have you ever thought about adding default values for your Odoo fields where the development is very limited? Think about a scenario where you are an Odoo Online user, or using studio mode development for your business needs, and you need your fields to have certain values depending on the current company. This would be a cake walk for users whose environment is self-hosted or hosted in the Odoo cloud platform. Odoo itself provides a solution for the above business scenario, that is, a user-defined defaults option available at Settings > Technical > Actions > User-defined Defaults.

For the proper accessibility for the above-mentioned situation, the user should activate the developer mode.

In this blog, we are going to create a new field in sales order through the studio and discuss how to set the field value to the default value based on the current company.

Below, you can see the custom field named Test Field, which was created through the studio.

What are User-defined Defaults in Odoo 19-cybrosys

And in the image below, you can see the available companies in our current database.

What are User-defined Defaults in Odoo 19-cybrosys

On the next step, we should navigate to the User-defined window to set up the default value corresponding to the available companies.

Navigate to Settings > Technical > Actions > User-defined Defaults

What are User-defined Defaults in Odoo 19-cybrosys

Here you can see the list of user-defined defaults, where you can click the New button to create your own default values for the newly created Test Field.

What are User-defined Defaults in Odoo 19-cybrosys

In the above image, you can see that in the Field, we have chosen our newly created field, and in the Company section, we can choose YourCompany. What simply happens is that when we create a new sales order, and the active company is YourCompany, the value in the Test field will be the value we set as the default value, which is YourCompany. In the screenshot below, you can clearly see what happens.

What are User-defined Defaults in Odoo 19-cybrosys

While we configure the the user defined default, there are two other fields: User and Condition. This is basically adding an extra condition for the default value. If the user is set to the default action, it only binds if the current user is the user configured in this field; likewise, we can add an extra condition in the Condition field.

In this blog, we have discussed how to set user-defined values for fields in Odoo, which can be a custom or default Odoo field. This is the best Odoo-provided solution to set a default value where custom development is limited or not possible at all. Use this Odoo built-in feature to make your business solution at its best.

To read more about A Complete Guide to Default Values in Odoo 19, refer to our blog A Complete Guide to Default Values in Odoo 19.


Frequently Asked Questions

Where can I find the User-defined Defaults menu?

You can access it by navigating to: Settings > Technical > Actions > User-defined Defaults. Developer Mode must be enabled to access this menu.

Can I set different default values for different companies?

Yes, you can set different values depending on the company.

What is the purpose of the User field?

The User field allows you to make the default value user-specific.

Do User-defined Defaults require any custom module development?

No, you don't need any custom module; this is an Odoo inbuilt feature.

If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message