Server Actions - Mass Sort Lines

server_action_sort
REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/18.0/server_action_sort
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), GRAP
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), GRAP
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Bhavesh Heliconia
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:19
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module provides a generic tools to have the possibility to sort the
lines of a list of items.

For exemple, if you use the sale module, you can want to reorder the
sale order lines, by any criterias.

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_ir_actions_server_form ir.actions.server xpath Inherits base.view_server_action_form
Models touched (2)

New fields (4)
  • sort_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', model_id), ('ttype', '=', 'one2many')]" string='Field to Sort'
  • sort_field_id_model Char
    related='sort_field_id.relation' string='Model of the Field to Sort'
  • sort_line_ids One2many → ir.actions.server.sort.line
    comodel_name='ir.actions.server.sort.line' inverse_name='action_id' string='Sorting Criterias'
  • state Selection
    ondelete={'sort': 'set default'} selection_add=[('sort', 'Sort')]
Public methods (0)

No public methods.

New fields (5)
  • action_id Many2one → ir.actions.server
    comodel_name='ir.actions.server' ondelete='cascade' required=True string='Action'
  • desc Boolean
    string='Inverse Order'
  • field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model', '=', parent.sort_field_id_model)]" ondelete='cascade' required=True
  • field_name Char
    related='field_id.name' store=True string='Field Name'
  • sequence Integer
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-backend
GIT
GIThttps://github.com/OCA/server-backend.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-backend/tree/16.0/server_action_sort
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), GRAP
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), GRAP
COMMITTERS
COMMITTERSSylvain LE GAL, Weblate, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/server-backend
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_ir_actions_server_form ir.actions.server xpath Inherits base.view_server_action_form
Models touched (2)

New fields (4)
  • sort_field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model_id', '=', model_id), ('ttype', '=', 'one2many')]" string='Field to Sort'
  • sort_field_id_model Char
    related='sort_field_id.relation' string='Model of the Field to Sort'
  • sort_line_ids One2many → ir.actions.server.sort.line
    comodel_name='ir.actions.server.sort.line' inverse_name='action_id' string='Sorting Criterias'
  • state Selection
    ondelete={'sort': 'set default'} selection_add=[('sort', 'Sort')]
Public methods (0)

No public methods.

New fields (5)
  • action_id Many2one → ir.actions.server
    comodel_name='ir.actions.server' ondelete='cascade' required=True string='Action'
  • desc Boolean
    string='Inverse Order'
  • field_id Many2one → ir.model.fields
    comodel_name='ir.model.fields' domain="[('model', '=', parent.sort_field_id_model)]" ondelete='cascade' required=True
  • field_name Char
    related='field_id.name' store=True string='Field Name'
  • sequence Integer
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-backend
PULL REQUEST
PULL REQUEST[19.0][MIG] server_action_sort: Migration to 19.0 (#449)