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

What are User-Defined Defaults in Odoo 18

Technical Odoo 18 Odoo Enterprises Odoo Community

Have you ever thought about adding a default value for your fields in your Odoo form view? Have you thought about minimizing your time while processing your daily task, or have you wished to see the value depending upon the company, user, or based on conditions? If so, today in this blog we are going to discuss the User-defined Defaults, a perfect Odoo default feature to solve the above business problem. Using this feature, you can set a default value to any fields in Odoo models depending on the user, company, or even with a condition. Let’s see how to implement this in Odoo 18.

First of all, you can view all the User-defined records In odoo 18 after enabling the developer mode from settings > Technical > Actions > User-defined Defaults

What are User-Defined Defaults in Odoo 18-cybrosys

And you can click on the New button from the list view to create a new default.

Below is the form view upon clicking the New button

What are User-Defined Defaults in Odoo 18-cybrosys

LabelUsage
FieldChoose the field to which you want to set the default value.
Default ValueThe value to set as default
ConditionIf set, apply the default value upon the described condition.
UserIf set, action binding only applies for this user.
CompanyIf set, action binding only applies for this company

Now let's create a default value; we need to implement a business scenario in which if the current company is My Company (San Francisco), then the sale order Payment Terms (Sales Order) should be defaulted to Immediate Payment. From my database I know the ID value of the Immediate Payment is 1. Configure the User-defined default to the one described below to achieve this.

What are User-Defined Defaults in Odoo 18-cybrosys

If you need this to be achieved based on the logged-in user as an extra condition, then you can configure the user field value based on your need.

Now let's open a new sale order from My Company (Chicago), and you can see the empty field value

What are User-Defined Defaults in Odoo 18-cybrosys

Now let's create a new sale order from My Company (San Francisco) and you can see the default value applied to Payment Terms

What are User-Defined Defaults in Odoo 18-cybrosys

In this blog we discussed how to set the default value to a specific field in your Odoo based on the conditions. This is a very efficient way provided by Odoo to set a default value and highly applicable where customization is hardly possible.

To read more about What are User-defined Defaults in Odoo 19, refer to our blog What are User-defined Defaults in Odoo 19.


Frequently Asked Questions

Where can I find User-defined Defaults in Odoo 19?

Enable Developer Mode and navigate to settings > Technical > Actions > User-defined Defaults.

Can I set default values without writing custom code?

Yes, you can set default values without writing custom code.

Can I apply defaults only for specific users?

Yes, you can apply defaults only for specific users

Do User-defined Defaults affect existing records?

No, This is only applied at the time of record creation.

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



0
Comments



Leave a comment



Recent Posts

WhatsApp