Skip to content

Commit 812b474

Browse files
committed
Merge PR #356 into 18.0
Signed-off-by dreispt
2 parents 5f0b94a + 8e836fc commit 812b474

26 files changed

+1446
-0
lines changed

server_action_sort/README.rst

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
================================
2+
Server Actions - Mass Sort Lines
3+
================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:e221269a77f3ad06e190cd3f0c72ecdfc6d1cd0022b81e3ec57722b3c6dad475
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github
20+
:target: https://github.com/OCA/server-backend/tree/18.0/server_action_sort
21+
:alt: OCA/server-backend
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/server-backend-18-0/server-backend-18-0-server_action_sort
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module provides a generic tools to have the possibility to sort the
32+
lines of a list of items.
33+
34+
For exemple, if you use the sale module, you can want to reorder the
35+
sale order lines, by any criterias.
36+
37+
**Table of contents**
38+
39+
.. contents::
40+
:local:
41+
42+
Configuration
43+
=============
44+
45+
- Go to 'Setting / Technical / Actions / Server Actions'
46+
- Create a new item
47+
48+
|image1|
49+
50+
- Set a name that will be used for the Contextual Action
51+
- choose a model
52+
- Select 'Sort' option in the field 'Action To Do'
53+
- Then, select a field to sort of this model. It should be a
54+
``one2many`` field.
55+
- Select then the criterias used to sort the selected field.
56+
57+
**Extra options**
58+
59+
- you can define groups whose members will have access to that option.
60+
61+
.. |image1| image:: https://raw.githubusercontent.com/OCA/server-backend/18.0/server_action_sort/static/description/ir_actions_server_form.png
62+
63+
Usage
64+
=====
65+
66+
- Go to a tree view, for a model for which you have defined a 'Sort'
67+
action.
68+
- Select some items you want to reorder.
69+
- click on 'Action' Button
70+
71+
|image1|
72+
73+
- then click on the name of the configured Action and see the results
74+
75+
**Before**
76+
77+
|image2|
78+
79+
**After**
80+
81+
|image3|
82+
83+
.. |image1| image:: https://raw.githubusercontent.com/OCA/server-backend/18.0/server_action_sort/static/description/sale_order_tree.png
84+
.. |image2| image:: https://raw.githubusercontent.com/OCA/server-backend/18.0/server_action_sort/static/description/sale_order_form_before.png
85+
.. |image3| image:: https://raw.githubusercontent.com/OCA/server-backend/18.0/server_action_sort/static/description/sale_order_form_after.png
86+
87+
Known issues / Roadmap
88+
======================
89+
90+
For instance, the module allow to order with many criterias, but without
91+
"dot" notation : it is not possible to order sale order lines by
92+
``product_id.seller_ids.code`` for exemple.
93+
94+
Bug Tracker
95+
===========
96+
97+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-backend/issues>`_.
98+
In case of trouble, please check there if your issue has already been reported.
99+
If you spotted it first, help us to smash it by providing a detailed and welcomed
100+
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20server_action_sort%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
101+
102+
Do not contact contributors directly about support or help with technical issues.
103+
104+
Credits
105+
=======
106+
107+
Authors
108+
-------
109+
110+
* GRAP
111+
112+
Contributors
113+
------------
114+
115+
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
116+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
117+
118+
- Bhavesh Heliconia
119+
120+
Maintainers
121+
-----------
122+
123+
This module is maintained by the OCA.
124+
125+
.. image:: https://odoo-community.org/logo.png
126+
:alt: Odoo Community Association
127+
:target: https://odoo-community.org
128+
129+
OCA, or the Odoo Community Association, is a nonprofit organization whose
130+
mission is to support the collaborative development of Odoo features and
131+
promote its widespread use.
132+
133+
.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
134+
:target: https://github.com/legalsylvain
135+
:alt: legalsylvain
136+
137+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
138+
139+
|maintainer-legalsylvain|
140+
141+
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/18.0/server_action_sort>`_ project on GitHub.
142+
143+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

server_action_sort/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

server_action_sort/__manifest__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
2+
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
{
6+
"name": "Server Actions - Mass Sort Lines",
7+
"version": "18.0.1.0.0",
8+
"author": "GRAP, " "Odoo Community Association (OCA)",
9+
"summary": "Sort any lines of any models by any criterias",
10+
"category": "Tools",
11+
"website": "https://github.com/OCA/server-backend",
12+
"license": "AGPL-3",
13+
"depends": ["base"],
14+
"maintainers": ["legalsylvain"],
15+
"data": [
16+
"security/ir.model.access.csv",
17+
"views/view_ir_actions_server.xml",
18+
],
19+
"demo": ["demo/ir_actions_server.xml"],
20+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
4+
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
5+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
6+
-->
7+
<odoo>
8+
<record id="sort_action_server_lines" model="ir.actions.server">
9+
<field name="name">Action Server Sort Lines</field>
10+
<field name="state">sort</field>
11+
<field name="model_id" ref="base.model_ir_actions_server" />
12+
<field
13+
name="sort_field_id"
14+
ref="server_action_sort.field_ir_actions_server__sort_line_ids"
15+
/>
16+
</record>
17+
18+
<record id="sort_action_server_lines_line_1" model="ir.actions.server.sort.line">
19+
<field name="sequence">1</field>
20+
<field name="action_id" ref="sort_action_server_lines" />
21+
<field name="desc" eval="False" />
22+
<field
23+
name="field_id"
24+
ref="server_action_sort.field_ir_actions_server_sort_line__field_name"
25+
/>
26+
</record>
27+
28+
<record id="sort_action_server_lines_line_2" model="ir.actions.server.sort.line">
29+
<field name="sequence">2</field>
30+
<field name="action_id" ref="sort_action_server_lines" />
31+
<field name="desc" eval="False" />
32+
<field
33+
name="field_id"
34+
ref="server_action_sort.field_ir_actions_server_sort_line__desc"
35+
/>
36+
</record>
37+
38+
<function model="ir.actions.server" name="create_action">
39+
<value eval="[ref('sort_action_server_lines')]" />
40+
</function>
41+
</odoo>

0 commit comments

Comments
 (0)