Skip to content

Commit adc8eb0

Browse files
[IMP] server_action_sort: pre-commit auto fixes
1 parent 9d12e38 commit adc8eb0

14 files changed

+83
-92
lines changed

server_action_sort/README.rst

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ Server Actions - Mass Sort Lines
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github
20-
:target: https://github.com/OCA/server-backend/tree/16.0/server_action_sort
20+
:target: https://github.com/OCA/server-backend/tree/18.0/server_action_sort
2121
:alt: OCA/server-backend
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/server-backend-16-0/server-backend-16-0-server_action_sort
23+
:target: https://translation.odoo-community.org/projects/server-backend-18-0/server-backend-18-0-server_action_sort
2424
:alt: Translate me on Weblate
2525
.. |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=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

31-
This module provides a generic tools to have the possibility to sort the lines
32-
of a list of items.
31+
This module provides a generic tools to have the possibility to sort the
32+
lines of a list of items.
3333

34-
For exemple, if you use the sale module, you can want to reorder the sale
35-
order lines, by any criterias.
34+
For exemple, if you use the sale module, you can want to reorder the
35+
sale order lines, by any criterias.
3636

3737
**Table of contents**
3838

@@ -42,81 +42,80 @@ order lines, by any criterias.
4242
Configuration
4343
=============
4444

45-
* Go to 'Setting / Technical / Actions / Server Actions'
45+
- Go to 'Setting / Technical / Actions / Server Actions'
46+
- Create a new item
4647

47-
* Create a new item
48-
49-
.. figure:: https://raw.githubusercontent.com/OCA/server-backend/16.0/server_action_sort/static/description/ir_actions_server_form.png
50-
51-
* Set a name that will be used for the Contextual Action
52-
53-
* choose a model
54-
55-
* Select 'Sort' option in the field 'Action To Do'
56-
57-
* Then, select a field to sort of this model. It should be a ``one2many`` field.
58-
59-
* Select then the criterias used to sort the selected field.
48+
|image1|
6049

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.
6156

6257
**Extra options**
6358

64-
* you can define groups whose members will have access to that option.
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
6562

6663
Usage
6764
=====
6865

69-
* Go to a tree view, for a model for which you have defined a 'Sort' action.
70-
71-
* Select some items you want to reorder.
72-
73-
* click on 'Action' Button
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
7470

75-
.. figure:: https://raw.githubusercontent.com/OCA/server-backend/16.0/server_action_sort/static/description/sale_order_tree.png
71+
|image1|
7672

77-
78-
* then click on the name of the configured Action and see the results
73+
- then click on the name of the configured Action and see the results
7974

8075
**Before**
8176

82-
.. figure:: https://raw.githubusercontent.com/OCA/server-backend/16.0/server_action_sort/static/description/sale_order_form_before.png
77+
|image2|
8378

8479
**After**
8580

86-
.. figure:: https://raw.githubusercontent.com/OCA/server-backend/16.0/server_action_sort/static/description/sale_order_form_after.png
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
8786

8887
Known issues / Roadmap
8988
======================
9089

91-
For instance, the module allow to order with many criterias, but
92-
without "dot" notation : it is not possible to order sale order lines
93-
by ``product_id.seller_ids.code`` for exemple.
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.
9493

9594
Bug Tracker
9695
===========
9796

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

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

105104
Credits
106105
=======
107106

108107
Authors
109-
~~~~~~~
108+
-------
110109

111110
* GRAP
112111

113112
Contributors
114-
~~~~~~~~~~~~
113+
------------
115114

116-
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
115+
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
117116

118117
Maintainers
119-
~~~~~~~~~~~
118+
-----------
120119

121120
This module is maintained by the OCA.
122121

@@ -136,6 +135,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
136135

137136
|maintainer-legalsylvain|
138137

139-
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/16.0/server_action_sort>`_ project on GitHub.
138+
This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/18.0/server_action_sort>`_ project on GitHub.
140139

141140
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

server_action_sort/demo/ir_actions_server.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
55
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66
-->
77
<odoo>
8-
98
<record id="sort_action_server_lines" model="ir.actions.server">
109
<field name="name">Action Server Sort Lines</field>
1110
<field name="state">sort</field>
@@ -39,5 +38,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3938
<function model="ir.actions.server" name="create_action">
4039
<value eval="[ref('sort_action_server_lines')]" />
4140
</function>
42-
4341
</odoo>

server_action_sort/models/ir_actions_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _run_action_sort_multi(self, eval_context=None):
4848
order_list = []
4949
for line in self.sort_line_ids:
5050
order_list.append(
51-
line.desc and "%s desc" % line.field_id.name or line.field_id.name
51+
f"{line.field_id.name} desc" if line.desc else line.field_id.name
5252
)
5353
order = ", ".join(order_list)
5454

server_action_sort/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- Go to 'Setting / Technical / Actions / Server Actions'
2+
- Create a new item
3+
4+
![](../static/description/ir_actions_server_form.png)
5+
6+
- Set a name that will be used for the Contextual Action
7+
- choose a model
8+
- Select 'Sort' option in the field 'Action To Do'
9+
- Then, select a field to sort of this model. It should be a `one2many`
10+
field.
11+
- Select then the criterias used to sort the selected field.
12+
13+
**Extra options**
14+
15+
- you can define groups whose members will have access to that option.

server_action_sort/readme/CONFIGURE.rst

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)

server_action_sort/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
This module provides a generic tools to have the possibility to sort the lines
2-
of a list of items.
1+
This module provides a generic tools to have the possibility to sort the
2+
lines of a list of items.
33

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

server_action_sort/readme/ROADMAP.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
For instance, the module allow to order with many criterias, but without
2+
"dot" notation : it is not possible to order sale order lines by
3+
`product_id.seller_ids.code` for exemple.

server_action_sort/readme/ROADMAP.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

server_action_sort/readme/USAGE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- Go to a tree view, for a model for which you have defined a 'Sort'
2+
action.
3+
- Select some items you want to reorder.
4+
- click on 'Action' Button
5+
6+
![](../static/description/sale_order_tree.png)
7+
8+
- then click on the name of the configured Action and see the results
9+
10+
**Before**
11+
12+
![](../static/description/sale_order_form_before.png)
13+
14+
**After**
15+
16+
![](../static/description/sale_order_form_after.png)

server_action_sort/readme/USAGE.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

server_action_sort/views/view_ir_actions_server.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
55
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
66
-->
77
<odoo>
8-
98
<record id="view_ir_actions_server_form" model="ir.ui.view">
109
<field name="model">ir.actions.server</field>
1110
<field name="inherit_id" ref="base.view_server_action_form" />
@@ -38,5 +37,4 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3837
</xpath>
3938
</field>
4039
</record>
41-
4240
</odoo>

0 commit comments

Comments
 (0)