Creating a Wizard to generate a Dynamic Field in Odoo

  • Odoo ERP

  • Published On April 16, 2021

Featured Image
Creating a Wizard to generate a Dynamic Field in Odoo

How to create wizards for creating dynamic fields Creation in Odoo?

First and foremost, let’s discuss wizards.

Wizards are used to interacting with dialogue boxes in Odoo. 

In Odoo, there are primarily two types of wizard models available: 

Abstract Model: The model class is the base of the vast majority of Odoo models. Furthermore, it has a long-term database, as shown by the fact that the data stored in the table rendered is accurate.

Transient Model: This is determined by the type’s transitional Data structure. Furthermore, the information stored in the data set is brief in this class, and information from the data set table is periodically fixed up.

[Also read: 10 New features of Odoo 15 that will entice you to upgrade]

Odoo uses a transitory/transient model in which data is saved temporarily and data in the wizard requires only temporary storage. following are the qualities of the transient model:

  • Data in the wizard can allude to standard records or many2one fields, but normal records cannot allude to many2one fields or wizard data.
  • Since data in the wizard needs only minimal storage, they are retransmitted after some time.
  • On wizard data, clients have all consents; they do not need direct access rights.

Readers from any business can have a better understanding of the next level if they consider the above details of wizards.

Since the readers are also students, we will first go over the Odoo Module, highlights, latest highlights, and installation before going over how to create wizards to create dynamic fields in Odoo.

This module can be used to create dynamic fields in an errand that does not require high performance. It is simple when using. Demonstration of the highlights, features, and fields that are part of the system.

What are the Benefits of creating dynamic fields in Odoo?

  • User -friendly 
  • The user doesn’t require any technical experience.
  • It is easy to add and remove any field.
  • It is easy to give a unique user group access to any field.
  • It is simple to add a custom tab to Task Form View.
  • On the Task Form view, add a custom area.
  • Use an image widget for the binary field.
  • Tags or checkboxes widgets are used in a variety of areas.
  • Help text, a necessary field, and a replicated field are also noteworthy features.
  • A radio widget for a related field.
  • For scorch fields, there is a phone, URL, and email gadget.
  • There are numerous field types available.
  • The widget is also available for one2one and many2many fields.
  • Some to one field selection widget.
  • It is simple to indicate the position of fields.

What are the Latest Odoo Features?

  • A binary widget has been added with Many-2-Many feature
  • A float time widget has been added to the hourly and minutely follow time.
  • An HTML widget has been added to the text area, which will be useful for viewing an HTML interface.
  • This feature was added to meet a requirement.

How to Add on feature for the new version (1.0.3)

  • It is simple to add a custom tab to the Task type view.

Installation Pattern:

> If it’s not too much hassle, you’ll be given a link to download the compressed record of the module.

> When you open the compressed folder, you will see the folder ‘bv_task_custom_fields.’

> Control V and Control C to insert this folder into your Odoo Custom Widget Path.

> Now, start Odoo in Developer Mode.

> Go to the Apps menu and select ‘Update Modules List,’ then press the Update button.

> Check for ‘bv_task_custom_fields’ in the search bar.

Odoo is an open-source program that provides nearly all fields available for express convenience. Regardless, in some market situations, we must add fields and retry in the same manner. It is difficult to create a field from code from the perspective of the end-user. So here is the requirement for constructing Dynamic fields in Odoo. 

[Also read: How to Choose the Right Odoo Partner for Your Business?]

Now let’s see Brainvire’s dynamic field creation in Odoo.

Referring to the above-mentioned features and installation would be useful in the understanding of the method.
If you are looking for the right Odoo Migration Company to take your business to the next-level, contact Brainvire today.

Initially, we created the following wizards to create a dynamic field:

To demonstrate the field’s types, we applied, selection=get_possible_field_types to the field, field_type, and the process get_possible_field_types is as follows:

In this view, each field has an alternative widget, including many2many tags, radio, and so on.

We have a method for changing the field type that is described below in order to return the widget based on the field type:

The view on the widget is as follows, ie, wizard.xml:

The following is the output:

To build the field, you need to use the following method:

In this model, the wizard includes a render field button, and when that button is clicked, the technique create_fields is executed.

[Also read: How to Transfer Files Securely and Quickly with SCP

Conclusion:

Brainvire, one of the leading Odoo ERP development services, can build a customized module and create dynamic fields in Odoo for your business. Connect with us, if you have any issues related to the current Odoo features, creating wizards, or for the Odoo open-source development model. Excellent Reading.

Read more: Odoo ERP Integrations: Payment Gateways, Social Media, SMS Gateways, Biometric Devices

    Looking to move to the cloud?

    Let our extended team be part of your journey and help you.

    Chirag Jogi
    About Author
    Chirag Jogi

    Chirag has worked with companies of all sizes, helping them use Odoo ERP to its fullest potential. With his expertise in Odoo ERP and years of experience working as a consultant, there isn't anything that he cannot do for your company. He can help you take full advantage of this powerful tool so you can boost your business growth. To catch up on Odoo ERP and its impact on your business, connect with Chirag today.

    Related Articles

    • Adobe Commerce Cloud and Odoo POS for an Omnichannel Experience
      Integration of Adobe Commerce Cloud and Odoo POS for an Omnichannel Experience

      As technology improves, we find more and more ways to use it in our everyday lives. As a result, the barriers between what we do online and in real life

    • What does the Newest Version of Odoo 14 Offer

      Odoo releases a new version every year, and this year being pandemic-ridden, as we all know the version roll-out was an online event. Right after the launch of Odoo 13

    • How Shipping Activities can Scale Up using Odoo-AFS Integration
      How Shipping Activities can Scale Up using Odoo-AFS Integration

      Shipping a package to a client can be frustrating at times! Your shipments can become misplaced at times. Your product could be affected. You will have to pay high-priced fees.