Odoo Help


Sort-Order for Custom-Module

on 11/3/16, 9:06 AM 671 views


for Products we added new relation to a custom Model ("Text-Line"). So in ech Product a user can add many single Text-Lines.

now the user should be able to "resort" the associated Text-Lines. For this reason we added a Integer Field "SortOrder" to the Model "Text-Line". In the Listview of the Textlines the User should be able to Move a Text-Line Up/Down with an arrow.

Is there any simple way in Odoo (or do you know any already existing Module/Addon) that uses such functionality to change the position/sorting of a related Module?


Ameera PP

--Ameera PP--
--Ameera PP--

Ameera PP
On 11/4/16, 1:10 AM

Hi Jack,

Define field in py file as:

class TextLine(models.Model):
    _name = 'Text-Line'   

   _order = 'sequence'

    sequence = fields.Integer(string='Sequence', default=1)

In the tree view of Text-Line in Products form: (text_line is the field defined in product form)

<field name="text_line" mode="tree,kanban"

   <tree string="Text Lines" >   

          <field name="sequence" widget="handle"/>



On 11/4/16, 6:18 AM

i tried that and the sqeunce field was added to the model. In DB the field increments correctly.

BUT: in the treeview the widget="handle" only adds an empty row. i can not drag/drop each row. if i click on that cell it opens a popup with the data of the text-line-Model.

UPDATE: myMistake --> in edit-view it works perfect.

ok... if it worked, please vote for it(tick the correct answer..it will help others to find the correct solution)

Ameera PP
on 11/5/16, 1:20 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/3/16, 9:06 AM
Seen: 671 times
Last updated: 11/7/16, 1:28 AM