Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] server_action_mass_edit: Migration to 18.0 #951

Open
wants to merge 26 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2bcba6c
[REF] rename 'mass_editing' module into 'server_action_mass_edit'
legalsylvain Oct 31, 2022
dc8d124
[UPD] french translation
legalsylvain Nov 2, 2022
00cb465
[IMP] server_action_mass_edit: Do not re-use demo and admin users to …
victoralmau Nov 29, 2022
cb14530
Translated using Weblate (Turkish)
tate11 Mar 9, 2023
8075c9a
Translated using Weblate (Slovenian)
sysadminmatmoz Apr 11, 2023
1fb3d1c
[ADD] server_action_mass_edit: add support for o2m fields
hbrunn Aug 23, 2023
984020b
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
73b58d4
Translated using Weblate (Italian)
mymage Oct 29, 2023
d7ea914
Translated using Weblate (French)
gregory-moka Oct 30, 2023
b641f94
Translated using Weblate (German)
jappi00 Dec 20, 2023
ec4b29b
Translated using Weblate (Italian)
mymage Dec 28, 2023
6092926
[FIX] server_action_mass_edit: 'Add' readded to many2many
Feb 16, 2024
d16dafc
Translated using Weblate (Swedish)
jakobkrabbe Feb 27, 2024
00a014b
[IMP] server_action_mass_edit: black, isort, prettier
CRogos May 6, 2024
ef9a9b7
[MIG] server_action_mass_edit: Migration to 17.0
rov-adhoc Mar 1, 2024
93b5209
[UPD] Update server_action_mass_edit.pot
May 6, 2024
9f46740
[BOT] post-merge updates
OCA-git-bot May 6, 2024
07ec11f
Update translation files
weblate May 7, 2024
b00e431
Translated using Weblate (Spanish (Mexico))
alan196 May 7, 2024
ec8de6d
Translated using Weblate (Italian)
mymage May 15, 2024
bcf49c0
[FIX] server_action_mess_edit: Application error when discard a x2man…
Vang-NguyenPhu Aug 30, 2024
e810fa1
[BOT] post-merge updates
OCA-git-bot Sep 7, 2024
e979640
[IMP] Improve documentation during OCA Days 2024 Workshop thanks to @…
cvinh Sep 30, 2024
15d51bd
[BOT] post-merge updates
OCA-git-bot Sep 30, 2024
6c91a90
[IMP] server_action_mass_edit: pre-commit auto fixes
trisdoan Nov 29, 2024
c22320c
[MIG] server_action_mass_edit: Migration to 18.0
trisdoan Oct 3, 2024
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
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
openupgradelib
168 changes: 168 additions & 0 deletions server_action_mass_edit/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
============
Mass Editing
============

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

.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-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/server_action_mass_edit
: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-server_action_mass_edit
: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 edit several records at the same time in any Odoo
model

**Difference in comparison to the Odoo Feature**

Since Odoo V13, a limited "mass Editing feature" is available in Odoo
CE.

This module provides the following extra features that are not in the
Core for the time being:

- Possibility to mass edit many fields in a single action
- Possibility to add a group to limit the usage of this function to
given people
- Possibility to filter the items the user can mass update
- Possibility to mass edit any fields with any widget. (For exemple
color fields, image fields, etc...)

**Table of contents**

.. contents::
:local:

Configuration
=============

- In developer mode, go to *Settings / Technical / Actions / Server
Actions*
- Create a new server action
- Name the server action (ie. *Product Template Category Mass Editing*)
- Choose Type *Mass Edit Records*
- Select the model
- Add the security groups allowed to use this action
- Add the fields you want to be mass edited

|Configuration|

- *Add Action*: Click on *Create Contextual Action* to add mass editing
in *Action* menu.

**Options**

- You can setup the widget option to be displayed (ie many2many_tags,
selection_image...)
- You can tick Apply Domain allowing you to limit the mass editing
action with a domain.
- You can add an extra message that will be displayed in the wizard.

.. |Configuration| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/server_action_mass_edit/static/description/mass_editing_form.png

Usage
=====

- *Go for Mass Editing*: select the records which you want to modify
and click on *Action* to open mass editing popup.

|Action|

- Select *Set / Remove* action and write down the value to set or
remove the value for the given field.

|Wizard Form|

- This way you can set / remove the values of the fields.

|Wizard Result|

.. |Action| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/server_action_mass_edit/static/description/mass_editing-item_tree.png
.. |Wizard Form| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/server_action_mass_edit/static/description/mass_editing-wizard_form.png
.. |Wizard Result| image:: https://raw.githubusercontent.com/OCA/server-ux/18.0/server_action_mass_edit/static/description/mass_editing-item_tree-result.png

Known issues / Roadmap
======================

- Auto add fields that are used in related domains if apply_domain=True

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:%20server_action_mass_edit%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
-------

* Serpent Consulting Services Pvt. Ltd.
* Tecnativa
* GRAP
* Iván Todorovich

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

- Oihane Crucelaegui <[email protected]>
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Jay Vora <[email protected]>
- Juan Negrete <[email protected]>
- Raul Martin <[email protected]>
- Aitor Bouzas <[email protected]>
- Sylvain LE GAL (https://twitter.com/legalsylvain)
- Iván Todorovich <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__

- Jairo Llopis
- Víctor Martínez

- Tatiana Deribina <[email protected]>
- Tris Doan <[email protected]>

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.

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/server_action_mass_edit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions server_action_mass_edit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import wizard
from .hooks import pre_init_hook
32 changes: 32 additions & 0 deletions server_action_mass_edit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2016 Serpent Consulting Services Pvt. Ltd. ([email protected])
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Mass Editing",
"version": "18.0.1.0.0",
"author": "Serpent Consulting Services Pvt. Ltd., "
"Tecnativa, "
"GRAP, "
"Iván Todorovich, "
"Odoo Community Association (OCA)",
"category": "Tools",
"website": "https://github.com/OCA/server-ux",
"license": "AGPL-3",
"summary": "Mass Editing",
"depends": [
"base",
],
"data": [
"security/ir.model.access.csv",
"views/ir_actions_server.xml",
"wizard/mass_editing_wizard.xml",
],
"assets": {
"web.assets_backend": [
"/server_action_mass_edit/static/src/js/record.esm.js",
"/server_action_mass_edit/static/src/js/static_list.esm.js",
]
},
"demo": ["demo/mass_editing.xml"],
"external_dependencies": {"python": ["openupgradelib"]},
"pre_init_hook": "pre_init_hook",
}
79 changes: 79 additions & 0 deletions server_action_mass_edit/demo/mass_editing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2020 - Iván Todorovich (https://twitter.com/ivan.todorovich)
Copyright (C) 2019 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<!-- Mass Edit User -->
<record id="mass_editing_user" model="ir.actions.server">
<field name="state">mass_edit</field>
<field name="name">Mass Edit</field>
<field name="model_id" ref="base.model_res_users" />
</record>
<record id="mass_editing_user_line_1" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__email" />
</record>
<record id="mass_editing_user_line_2" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__phone" />
</record>
<record id="mass_editing_user_line_3" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__category_id" />
</record>
<record id="mass_editing_user_line_4" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__comment" />
</record>
<record id="mass_editing_user_line_5" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__country_id" />
</record>
<record id="mass_editing_user_line_6" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__is_company" />
</record>
<record id="mass_editing_user_line_7" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__lang" />
</record>
<record id="mass_editing_user_line_8" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__title" />
</record>
<record id="mass_editing_user_line_9" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__company_type" />
</record>
<record id="mass_editing_user_line_10" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__image_1920" />
<field name="widget_option">image</field>
</record>
<record id="mass_editing_user_line_11" model="ir.actions.server.mass.edit.line">
<field name="server_action_id" ref="mass_editing_user" />
<field name="field_id" ref="base.field_res_users__bank_ids" />
</record>

<!-- Mass Edit Partner Title -->
<record id="mass_editing_partner_title" model="ir.actions.server">
<field name="state">mass_edit</field>
<field name="name">Mass Edit</field>
<field name="model_id" ref="base.model_res_partner_title" />
</record>
<record
id="mass_editing_partner_title_line_1"
model="ir.actions.server.mass.edit.line"
>
<field name="server_action_id" ref="mass_editing_partner_title" />
<field name="field_id" ref="base.field_res_partner_title__shortcut" />
</record>

<!-- Add context actions -->
<function model="ir.actions.server" name="create_action">
<value eval="[ref('mass_editing_user'), ref('mass_editing_partner_title')]" />
</function>
</odoo>
16 changes: 16 additions & 0 deletions server_action_mass_edit/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Camptocamp (<https://www.camptocamp.com>)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from openupgradelib import openupgrade


def pre_init_hook(env):
if openupgrade.table_exists(env.cr, "mass_editing_line"):
openupgrade.rename_models(

Check warning on line 8 in server_action_mass_edit/hooks.py

View check run for this annotation

Codecov / codecov/patch

server_action_mass_edit/hooks.py#L8

Added line #L8 was not covered by tests
env.cr, [("mass.editing.line", "ir.actions.server.mass.edit.line")]
)
openupgrade.rename_tables(

Check warning on line 11 in server_action_mass_edit/hooks.py

View check run for this annotation

Codecov / codecov/patch

server_action_mass_edit/hooks.py#L11

Added line #L11 was not covered by tests
env.cr, [("mass_editing_line", "ir_actions_server_mass_edit_line")]
)

modules = [("mass_editing", "server_action_mass_edit")]
openupgrade.update_module_names(env.cr, modules, merge_modules=True)

Check warning on line 16 in server_action_mass_edit/hooks.py

View check run for this annotation

Codecov / codecov/patch

server_action_mass_edit/hooks.py#L15-L16

Added lines #L15 - L16 were not covered by tests
Loading
Loading