From 4250b2f05c4d648185dc187a65554b1d91e76bd4 Mon Sep 17 00:00:00 2001 From: Aitor Bouzas Date: Mon, 8 Oct 2018 12:33:21 +0200 Subject: [PATCH] [MIG] mass_editing: Migration to 12.0 Test coverage --- mass_editing/README.rst | 69 ++- mass_editing/__manifest__.py | 4 +- mass_editing/hooks.py | 10 +- mass_editing/models/__init__.py | 1 - mass_editing/models/ir_model_fields.py | 2 +- mass_editing/models/mass_object.py | 5 +- mass_editing/readme/CONFIGURE.rst | 4 + mass_editing/readme/CONTRIBUTORS.rst | 7 + mass_editing/readme/DESCRIPTION.rst | 7 + mass_editing/readme/USAGE.rst | 32 ++ mass_editing/static/description/index.html | 466 +++++++++++++++++++++ mass_editing/tests/__init__.py | 1 - mass_editing/tests/test_mass_editing.py | 19 +- mass_editing/wizard/__init__.py | 2 - mass_editing/wizard/mass_editing_wizard.py | 4 +- 15 files changed, 595 insertions(+), 38 deletions(-) create mode 100644 mass_editing/readme/CONFIGURE.rst create mode 100644 mass_editing/readme/CONTRIBUTORS.rst create mode 100644 mass_editing/readme/DESCRIPTION.rst create mode 100644 mass_editing/readme/USAGE.rst create mode 100644 mass_editing/static/description/index.html diff --git a/mass_editing/README.rst b/mass_editing/README.rst index 559b736..60d3ba5 100644 --- a/mass_editing/README.rst +++ b/mass_editing/README.rst @@ -1,25 +1,47 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ============ Mass Editing ============ +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.0/mass_editing + :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-12-0/server-ux-12-0-mass_editing + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/250/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + + This module provides the following features: * You can add, update or remove the values of more than one records on the fly at the same time. * You can configure mass editing for any Odoo model. -Installation -============ -No external library is used. +**Table of contents** + +.. contents:: + :local: Configuration ============= + To configure this module, you need to: * Go to *Settings / Mass Editing / Mass Editing* and configure the object and fields for Mass Editing. @@ -63,21 +85,25 @@ As shown in figure you have to configure the object and fields for mass editing. Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Serpent Consulting Services Pvt. Ltd. +* Tecnativa +* AdaptiveCity Contributors ------------- +~~~~~~~~~~~~ * Oihane Crucelaegui * Serpent Consulting Services Pvt. Ltd. @@ -85,18 +111,21 @@ Contributors * Jairo Llopis * Juan Negrete * Raul Martin +* Aitor Bouzas + +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/server-ux `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mass_editing/__manifest__.py b/mass_editing/__manifest__.py index 70e1a71..6dec5e7 100644 --- a/mass_editing/__manifest__.py +++ b/mass_editing/__manifest__.py @@ -1,8 +1,8 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Mass Editing', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': 'Serpent Consulting Services Pvt. Ltd., ' 'Tecnativa, ' 'Odoo Community Association (OCA)', diff --git a/mass_editing/hooks.py b/mass_editing/hooks.py index 7ee3f89..38e9346 100644 --- a/mass_editing/hooks.py +++ b/mass_editing/hooks.py @@ -1,10 +1,14 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo.api import Environment, SUPERUSER_ID + def uninstall_hook(cr, registry): """Delete the actions that were created with mass_editing when the module is uninstalled""" - cr.execute("""DELETE FROM ir_act_window - WHERE res_model = 'mass.editing.wizard'""") + env = Environment(cr, SUPERUSER_ID, {}) + env['ir.actions.act_window'].search([ + ('res_model', '=', 'mass.editing.wizard') + ]).unlink() return True diff --git a/mass_editing/models/__init__.py b/mass_editing/models/__init__.py index d867b13..e596217 100644 --- a/mass_editing/models/__init__.py +++ b/mass_editing/models/__init__.py @@ -1,4 +1,3 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ir_model_fields diff --git a/mass_editing/models/ir_model_fields.py b/mass_editing/models/ir_model_fields.py index 235d3d9..ebec6ef 100644 --- a/mass_editing/models/ir_model_fields.py +++ b/mass_editing/models/ir_model_fields.py @@ -1,4 +1,4 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models diff --git a/mass_editing/models/mass_object.py b/mass_editing/models/mass_object.py index 3bae49f..ecbae45 100644 --- a/mass_editing/models/mass_object.py +++ b/mass_editing/models/mass_object.py @@ -1,4 +1,4 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models, _ @@ -58,7 +58,7 @@ class MassObject(models.Model): 'src_model': src_obj, 'view_type': 'form', 'context': "{'mass_editing_object' : %d}" % (self.id), - 'view_mode': 'form, tree', + 'view_mode': 'form', 'target': 'new', 'binding_model_id': self.model_id.id, 'binding_type': 'action', @@ -77,6 +77,7 @@ class MassObject(models.Model): self.unlink_action() return super(MassObject, self).unlink() + @api.multi @api.returns('self', lambda value: value.id) def copy(self, default=None): if default is None: diff --git a/mass_editing/readme/CONFIGURE.rst b/mass_editing/readme/CONFIGURE.rst new file mode 100644 index 0000000..787e9c4 --- /dev/null +++ b/mass_editing/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ + +To configure this module, you need to: + +* Go to *Settings / Mass Editing / Mass Editing* and configure the object and fields for Mass Editing. diff --git a/mass_editing/readme/CONTRIBUTORS.rst b/mass_editing/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..0e4522a --- /dev/null +++ b/mass_editing/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Oihane Crucelaegui +* Serpent Consulting Services Pvt. Ltd. +* Jay Vora +* Jairo Llopis +* Juan Negrete +* Raul Martin +* Aitor Bouzas diff --git a/mass_editing/readme/DESCRIPTION.rst b/mass_editing/readme/DESCRIPTION.rst new file mode 100644 index 0000000..2af60ca --- /dev/null +++ b/mass_editing/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ + +This module provides the following features: + +* You can add, update or remove the values of more than one records on the fly at the same time. + +* You can configure mass editing for any Odoo model. + diff --git a/mass_editing/readme/USAGE.rst b/mass_editing/readme/USAGE.rst new file mode 100644 index 0000000..558e9a6 --- /dev/null +++ b/mass_editing/readme/USAGE.rst @@ -0,0 +1,32 @@ +This module allows to add, update or remove the values of more than one records on the fly at the same time. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/250/11.0 + +As shown in figure you have to configure the object and fields for mass editing. + +* Select the object and add the fields of that object on which you want to apply mass editing. + +.. image:: /mass_editing/static/description/mass_editing-1.png + :width: 70% + +* *Add Action*: As shown in figure click on *Add Sidebar Button* to add mass editing option in *Action* option in action. + +.. image:: /mass_editing/static/description/mass_editing-2.png + :width: 70% + +* *Go for Mass Editing*: As shown in figure, select the records which you want to modify and click on *Action* to open mass editing popup. + +.. image:: /mass_editing/static/description/mass_editing-3.png + :width: 70% + +* Select *Set / Remove* action and write down the value to set or remove the value for the given field. + +.. image:: /mass_editing/static/description/mass_editing-4.png + :width: 70% + +* This way you can set / remove the values of the fields. + +.. image:: /mass_editing/static/description/mass_editing-5.png + :width: 70% diff --git a/mass_editing/static/description/index.html b/mass_editing/static/description/index.html new file mode 100644 index 0000000..4e92384 --- /dev/null +++ b/mass_editing/static/description/index.html @@ -0,0 +1,466 @@ + + + + + + +Mass Editing + + + +
+

Mass Editing

+ + +

Beta License: AGPL-3 OCA/server-ux Translate me on Weblate Try me on Runbot

+

This module provides the following features:

+
    +
  • You can add, update or remove the values of more than one records on the fly at the same time.
  • +
  • You can configure mass editing for any Odoo model.
  • +
+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  • Go to Settings / Mass Editing / Mass Editing and configure the object and fields for Mass Editing.
  • +
+
+
+

Usage

+

This module allows to add, update or remove the values of more than one records on the fly at the same time.

+Try me on Runbot +

As shown in figure you have to configure the object and fields for mass editing.

+
    +
  • Select the object and add the fields of that object on which you want to apply mass editing.
  • +
+/mass_editing/static/description/mass_editing-1.png +
    +
  • Add Action: As shown in figure click on Add Sidebar Button to add mass editing option in Action option in action.
  • +
+/mass_editing/static/description/mass_editing-2.png +
    +
  • Go for Mass Editing: As shown in figure, select the records which you want to modify and click on Action to open mass editing popup.
  • +
+/mass_editing/static/description/mass_editing-3.png +
    +
  • Select Set / Remove action and write down the value to set or remove the value for the given field.
  • +
+/mass_editing/static/description/mass_editing-4.png +
    +
  • This way you can set / remove the values of the fields.
  • +
+/mass_editing/static/description/mass_editing-5.png +
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Serpent Consulting Services Pvt. Ltd.
  • +
  • Tecnativa
  • +
  • AdaptiveCity
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

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

+
+
+
+ + diff --git a/mass_editing/tests/__init__.py b/mass_editing/tests/__init__.py index c1f46a4..86a48b9 100644 --- a/mass_editing/tests/__init__.py +++ b/mass_editing/tests/__init__.py @@ -1,4 +1,3 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_mass_editing diff --git a/mass_editing/tests/test_mass_editing.py b/mass_editing/tests/test_mass_editing.py index 9f1ba6d..39f6fb8 100644 --- a/mass_editing/tests/test_mass_editing.py +++ b/mass_editing/tests/test_mass_editing.py @@ -1,4 +1,5 @@ -# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com) +# Copyright 2018 Aitor Bouzas