Purpose of the Handle widget
There are different widgets in Odoo. Handle widget was one among them. Widgets are Mainly used inside the views. It would help us reorder according to the sequence. The widget will help to change the order and that makes it easy to use. It will not remove the record, only it will slide lines up and down. In most cases, we have to make the second to be first and the first record to be second. In these cases, we have to use this widget, in the tree’s case view, there a cross sign will be visible. By sliding that, we can rearrange the order of the records. Please note that while there can be no symbols for the kanban view, we can change the order of the records all the same.
Handle Widget for Kanban View in Odoo
The main purpose of the handle widget is to change the order of the specified records. If suppose you need a specified order, then the user could create it in some order, and then with the help of the handle widget, it can be replaced. Making it some specified order you can also possible with the help of this widget.
Creating Fields and Models
In the following example, we are about to create a completely custom model. There we have to specify the sequence field with a type of integer. We can specify the fields we need.
Create a Kanban View in Odoo
A kanban view in order to make replace the order of the images. Hence we needed to define the kanban view in the XML. In the kanban view, we have to specify the corresponding sequence. The sequence should be in the Integer field, and it should be specified in the XML view. With the help of the sequence field, we can make the movements or exchange the specified order. It displayed the images as new attachments according to their order in there. Attachment. Such situations can be handled using this widget, which makes swapping the order very convenient for users.
Need to upload an image, and also, we have to specify the corresponding filename. Each file has its own specific name. If the user wants to give another name to the file, it should be created over the field file name. After that, we can view the kanban view will be like this:
Create Tree view
Initially, We need a tree view. It is easier to use. There will be a symbol in the tree view in order to change the order of the records. In the tree view, we have to specify a sequence. With the help of the sequence, we can change the order of the records and swap the records.
We need to upload the image that must be uploaded. In this example, we are going to add three files within the names FILE1, FILE2, and FILE3. Besides the file name, there needs to be a symbol that shows that we can change the order of the records that have been created. The symbol needs to be shown whenever this handle widget is used. After adding the files, we need the tree view should be like that given below:
So here we are going to change the order to FILE2 with FILE1. Swapping FILE2 with FILE1. And the result should be like this: