Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions base_ir_actions_sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=====================
Base Actions Sequence
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1be150d924e786874a620261feb0c42bdb392b6cce451367e39de04e1e84c6a5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/18.0/base_ir_actions_sequence
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_ir_actions_sequence
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to assign sequence to every action
(``ir.actions.actions``), and therefore any model that inherits from it
(like ``ir.actions.report``, ``ir.actions.server``,
``ir.actions.act_window``...) can be ordered by sequence.

This is useful when you want to control the order of actions displayed
in various parts of the Odoo interface, such as the order of reports in
the print menu, or the order of server actions in the action menu.

**Table of contents**

.. contents::
:local:

Usage
=====

This module introduces the base to add the ability to edit the order in
which records of models that inherit from ir.actions.actions.

To use this module, you need to (example for Reports):

#. Activate the developer mode #. Go to *Settings > Technical >
Reports*. #. Search for any Report and edit its sequence. #. The reports
will be ordered by sequence in the print menu.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20base_ir_actions_sequence%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- `ForgeFlow <https://www.forgeflow.com>`__:

- Jaume Bernaus

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/18.0/base_ir_actions_sequence>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions base_ir_actions_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions base_ir_actions_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 ForgeFlow, S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Base Actions Sequence",
"version": "18.0.1.0.0",
"category": "Extra Tools",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-ux",
"license": "LGPL-3",
"depends": ["base"],
"data": ["views/actions_views.xml"],
"installable": True,
}
30 changes: 30 additions & 0 deletions base_ir_actions_sequence/i18n/base_ir_actions_sequence.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * base_ir_actions_sequence
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: base_ir_actions_sequence
#: model:ir.model,name:base_ir_actions_sequence.model_ir_actions_actions
msgid "Actions"
msgstr ""

#. module: base_ir_actions_sequence
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_act_url__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_act_window__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_act_window_close__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_actions__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_client__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_report__priority
#: model:ir.model.fields,field_description:base_ir_actions_sequence.field_ir_actions_server__priority
msgid "Sequence"
msgstr ""
1 change: 1 addition & 0 deletions base_ir_actions_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_actions
19 changes: 19 additions & 0 deletions base_ir_actions_sequence/models/ir_actions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import fields, models, tools
from odoo.tools import frozendict


class IrActions(models.Model):
_inherit = "ir.actions.actions"

sequence = fields.Integer(default=16, required=True)

@tools.ormcache("model_name", "self.env.lang")
def _get_bindings(self, model_name):
result = dict(super()._get_bindings(model_name))
# Only for 'report' type, since for 'action' type the bindings are
# managed in the original _get_bindings method
if result.get("report"):
result["report"] = tuple(
sorted(result["report"], key=lambda vals: vals.get("sequence", 0))
)
return frozendict(result)
3 changes: 3 additions & 0 deletions base_ir_actions_sequence/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions base_ir_actions_sequence/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [ForgeFlow](https://www.forgeflow.com):
- Jaume Bernaus
7 changes: 7 additions & 0 deletions base_ir_actions_sequence/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module allows to assign sequence to every action (``ir.actions.actions``),
and therefore any model that inherits from it (like ``ir.actions.report``,
``ir.actions.server``, ``ir.actions.act_window``...) can be ordered by sequence.

This is useful when you want to control the order of actions displayed in
various parts of the Odoo interface, such as the order of reports in the print
menu, or the order of server actions in the action menu.
9 changes: 9 additions & 0 deletions base_ir_actions_sequence/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This module introduces the base to add the ability to edit the order in which
records of models that inherit from ir.actions.actions.

To use this module, you need to (example for Reports):

#. Activate the developer mode
#. Go to *Settings > Technical > Reports*.
#. Search for any Report and edit its sequence.
#. The reports will be ordered by sequence in the print menu.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading