product_library adds some fields to product and some utilities addons from OCA
This commit is contained in:
parent
9145e0cabe
commit
6c8876b991
334 changed files with 92878 additions and 0 deletions
85
mass_operation_abstract/README.rst
Normal file
85
mass_operation_abstract/README.rst
Normal file
|
@ -0,0 +1,85 @@
|
|||
=======================
|
||||
Mass Operation Abstract
|
||||
=======================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! 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_operation_abstract
|
||||
: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_operation_abstract
|
||||
: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 generic tools to develop modules that process mass
|
||||
operations on any models.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
* refactor ``mass_editing`` and ``mass_sorting`` OCA modules to depend on
|
||||
this module.
|
||||
|
||||
* Develop new modules like:
|
||||
|
||||
1. ``mass_scripting`` to have the possibility to execute custom python code
|
||||
on any model, for selected items.
|
||||
|
||||
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 smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20mass_operation_abstract%0Aversion:%2012.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
|
||||
~~~~~~~
|
||||
|
||||
* GRAP
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
|
||||
|
||||
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/12.0/mass_operation_abstract>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
2
mass_operation_abstract/__init__.py
Normal file
2
mass_operation_abstract/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
from . import models
|
||||
from . import wizard
|
21
mass_operation_abstract/__manifest__.py
Normal file
21
mass_operation_abstract/__manifest__.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# Copyright (C) 2018 - 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).
|
||||
|
||||
|
||||
{
|
||||
"name": "Mass Operation Abstract",
|
||||
"version": "12.0.1.1.0",
|
||||
"author": "GRAP, " "Odoo Community Association (OCA)",
|
||||
"summary": "Abstract Tools used for modules that realize operation on" "many items",
|
||||
"category": "Tools",
|
||||
"website": "https://github.com/OCA/server-ux",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["base"],
|
||||
"data": [
|
||||
"views/menu.xml",
|
||||
"views/view_mass_operation_mixin.xml",
|
||||
"views/view_mass_operation_wizard_mixin.xml",
|
||||
],
|
||||
"demo": ["demo/res_groups.xml"],
|
||||
}
|
13
mass_operation_abstract/demo/res_groups.xml
Normal file
13
mass_operation_abstract/demo/res_groups.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018 - 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>
|
||||
|
||||
<record id="base.group_no_one" model="res.groups">
|
||||
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
193
mass_operation_abstract/i18n/es.po
Normal file
193
mass_operation_abstract/i18n/es.po
Normal file
|
@ -0,0 +1,193 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mass_operation_abstract
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-10-30 23:08+0000\n"
|
||||
"Last-Translator: Harald Panten <harald.panten@sygel.es>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:81
|
||||
#, python-format
|
||||
msgid "%s (copy)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_mixin
|
||||
msgid "Abstract Mass Operations"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_wizard_mixin
|
||||
msgid "Abstract Mass Operations Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__action_name
|
||||
msgid "Action Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Add sidebar button"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__group_ids
|
||||
msgid "Allowed Groups"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Apply"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__display_name
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Display a button in the sidebar of related model to open a wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__domain
|
||||
msgid "Domain"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__id
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,help:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
msgid "If set, this message will be displayed in the wizard."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin____last_update
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:18
|
||||
#, python-format
|
||||
msgid "Mass Operation (%s)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.ui.menu,name:mass_operation_abstract.menu_mass_operation
|
||||
msgid "Mass Operations"
|
||||
msgstr "Operaciones masivas"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__message
|
||||
msgid "Message"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__model_id
|
||||
msgid "Model"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:65
|
||||
#, python-format
|
||||
msgid "None of the %d items you have selected can be processed."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_danger
|
||||
msgid "Operation Description Danger"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_info
|
||||
msgid "Operation Description Info"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_warning
|
||||
msgid "Operation Description Warning"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__remaining_item_qty
|
||||
msgid "Remaining Item Qty"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Remove sidebar button"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Security"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__selected_item_qty
|
||||
msgid "Selected Item Qty"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__ref_ir_act_window_id
|
||||
msgid "Sidebar Action"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Technical Informations"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:54
|
||||
#, python-format
|
||||
msgid "The treatment will be processed on the %d selected elements."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:60
|
||||
#, python-format
|
||||
msgid "You have selected %d items that can not be processed. Only %d items will be processed."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:84
|
||||
#, python-format
|
||||
msgid "there is no more element that corresponds to the rules of the domain.\n"
|
||||
" Please refresh your list and try to select again the items."
|
||||
msgstr ""
|
204
mass_operation_abstract/i18n/fr.po
Normal file
204
mass_operation_abstract/i18n/fr.po
Normal file
|
@ -0,0 +1,204 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mass_operation_abstract
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-02-24 12:11+0000\n"
|
||||
"PO-Revision-Date: 2020-02-24 12:11+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:81
|
||||
#, python-format
|
||||
msgid "%s (copy)"
|
||||
msgstr "%s (copie)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_mixin
|
||||
msgid "Abstract Mass Operations"
|
||||
msgstr "Opérations en lot (modèle abstrait)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_wizard_mixin
|
||||
msgid "Abstract Mass Operations Wizard"
|
||||
msgstr "Assistant d'opérations en lot (modèle abstrait)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__action_name
|
||||
msgid "Action Name"
|
||||
msgstr "Nom de l'action"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Add sidebar button"
|
||||
msgstr "Ajouter le boutton à la barre latérale"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__group_ids
|
||||
msgid "Allowed Groups"
|
||||
msgstr "Groupes autorisés"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Apply"
|
||||
msgstr "Appliquer"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__display_name
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Afficher Nom"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Display a button in the sidebar of related model to open a wizard"
|
||||
msgstr ""
|
||||
"Affichier un bouton dans la barre latérale du module associé, pour ouvrir "
|
||||
"l'assistant"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__domain
|
||||
msgid "Domain"
|
||||
msgstr "Domaine"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__id
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,help:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
msgid "If set, this message will be displayed in the wizard."
|
||||
msgstr "Si ce champ est défini, le message sera affiché dans l'assistant"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin____last_update
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:18
|
||||
#, python-format
|
||||
msgid "Mass Operation (%s)"
|
||||
msgstr "Opération en lot (%s)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.ui.menu,name:mass_operation_abstract.menu_mass_operation
|
||||
msgid "Mass Operations"
|
||||
msgstr "Opérations en lot"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__message
|
||||
msgid "Message"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__model_id
|
||||
msgid "Model"
|
||||
msgstr "Modèle"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__name
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:65
|
||||
#, python-format
|
||||
msgid "None of the %d items you have selected can be processed."
|
||||
msgstr "Aucun des %d éléments que vous avez sélectionné ne peut être traités."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_danger
|
||||
msgid "Operation Description Danger"
|
||||
msgstr "Description de l'opération - Danger"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_info
|
||||
msgid "Operation Description Info"
|
||||
msgstr "Description de l'opération - Information"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_warning
|
||||
msgid "Operation Description Warning"
|
||||
msgstr "Description de l'opération - Attention"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__remaining_item_qty
|
||||
msgid "Remaining Item Qty"
|
||||
msgstr "Nombre d'éléments restants"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Remove sidebar button"
|
||||
msgstr "Retirer le boutton de la barre latérale"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Security"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__selected_item_qty
|
||||
msgid "Selected Item Qty"
|
||||
msgstr "Nombre d'éléments sélectionnés"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Settings"
|
||||
msgstr "Configuration"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__ref_ir_act_window_id
|
||||
msgid "Sidebar Action"
|
||||
msgstr "Action de la barre latérale"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Technical Informations"
|
||||
msgstr "Informations techniques"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:54
|
||||
#, python-format
|
||||
msgid "The treatment will be processed on the %d selected elements."
|
||||
msgstr "Le traitement sera réalisé sur les %d éléments sélectionnés."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:60
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You have selected %d items that can not be processed. Only %d items will be "
|
||||
"processed."
|
||||
msgstr ""
|
||||
"Vous avez sélectionné %d éléments qui ne peuvent pas être traités. Seulement "
|
||||
"%d éléments vont être traités."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:84
|
||||
#, python-format
|
||||
msgid ""
|
||||
"there is no more element that corresponds to the rules of the domain.\n"
|
||||
" Please refresh your list and try to select again the items."
|
||||
msgstr ""
|
||||
"Il n'y a pas d'élément qui correspond aux règles d'accès définis par le "
|
||||
"domaine.\n"
|
||||
"Veuillez rafraichir la liste des éléments, et sélectionner des éléments de "
|
||||
"nouveau"
|
191
mass_operation_abstract/i18n/it.po
Normal file
191
mass_operation_abstract/i18n/it.po
Normal file
|
@ -0,0 +1,191 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mass_operation_abstract
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:81
|
||||
#, python-format
|
||||
msgid "%s (copy)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_mixin
|
||||
msgid "Abstract Mass Operations"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_wizard_mixin
|
||||
msgid "Abstract Mass Operations Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__action_name
|
||||
msgid "Action Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Add sidebar button"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__group_ids
|
||||
msgid "Allowed Groups"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Apply"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__display_name
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Display a button in the sidebar of related model to open a wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__domain
|
||||
msgid "Domain"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__id
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,help:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
msgid "If set, this message will be displayed in the wizard."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin____last_update
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:18
|
||||
#, python-format
|
||||
msgid "Mass Operation (%s)"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.ui.menu,name:mass_operation_abstract.menu_mass_operation
|
||||
msgid "Mass Operations"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__message
|
||||
msgid "Message"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__model_id
|
||||
msgid "Model"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__name
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:65
|
||||
#, python-format
|
||||
msgid "None of the %d items you have selected can be processed."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_danger
|
||||
msgid "Operation Description Danger"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_info
|
||||
msgid "Operation Description Info"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_warning
|
||||
msgid "Operation Description Warning"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__remaining_item_qty
|
||||
msgid "Remaining Item Qty"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Remove sidebar button"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Security"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__selected_item_qty
|
||||
msgid "Selected Item Qty"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__ref_ir_act_window_id
|
||||
msgid "Sidebar Action"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Technical Informations"
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:54
|
||||
#, python-format
|
||||
msgid "The treatment will be processed on the %d selected elements."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:60
|
||||
#, python-format
|
||||
msgid "You have selected %d items that can not be processed. Only %d items will be processed."
|
||||
msgstr ""
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:84
|
||||
#, python-format
|
||||
msgid "there is no more element that corresponds to the rules of the domain.\n"
|
||||
" Please refresh your list and try to select again the items."
|
||||
msgstr ""
|
199
mass_operation_abstract/i18n/pt.po
Normal file
199
mass_operation_abstract/i18n/pt.po
Normal file
|
@ -0,0 +1,199 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * mass_operation_abstract
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-10-09 00:08+0000\n"
|
||||
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: pt\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 3.10\n"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:81
|
||||
#, python-format
|
||||
msgid "%s (copy)"
|
||||
msgstr "%s (cópia)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_mixin
|
||||
msgid "Abstract Mass Operations"
|
||||
msgstr "Operações em Massa Abstratas"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model,name:mass_operation_abstract.model_mass_operation_wizard_mixin
|
||||
msgid "Abstract Mass Operations Wizard"
|
||||
msgstr "Assistente de Operações em Massa Abstratas"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__action_name
|
||||
msgid "Action Name"
|
||||
msgstr "Nome da Ação"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Add sidebar button"
|
||||
msgstr "Adicionar botão da barra lateral"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__group_ids
|
||||
msgid "Allowed Groups"
|
||||
msgstr "Grupos Permitidos"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Apply"
|
||||
msgstr "Aplicar"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_wizard_mixin_form
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__display_name
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome a Exibir"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Display a button in the sidebar of related model to open a wizard"
|
||||
msgstr ""
|
||||
"Mostrar um botão na barra lateral do modelo relacionado para abrir um "
|
||||
"assistente"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__domain
|
||||
msgid "Domain"
|
||||
msgstr "Domínio"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__id
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__id
|
||||
msgid "ID"
|
||||
msgstr "Id"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,help:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
msgid "If set, this message will be displayed in the wizard."
|
||||
msgstr "Se atribuído, esta mensagem será exibida no assistente."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin____last_update
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Última Modificação em"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/models/mass_operation_mixin.py:18
|
||||
#, python-format
|
||||
msgid "Mass Operation (%s)"
|
||||
msgstr "Operação em Massa (%s)"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.ui.menu,name:mass_operation_abstract.menu_mass_operation
|
||||
msgid "Mass Operations"
|
||||
msgstr "Operações em Massa"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__message
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__message
|
||||
msgid "Message"
|
||||
msgstr "Mensagem"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__model_id
|
||||
msgid "Model"
|
||||
msgstr "Modelo"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__name
|
||||
msgid "Name"
|
||||
msgstr "Nome"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:65
|
||||
#, python-format
|
||||
msgid "None of the %d items you have selected can be processed."
|
||||
msgstr "Nenhum dos %d itens que selecionou podem ser processados."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_danger
|
||||
msgid "Operation Description Danger"
|
||||
msgstr "Perigo da Descrição da Operação"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_info
|
||||
msgid "Operation Description Info"
|
||||
msgstr "Info da Descrição da Operação"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__operation_description_warning
|
||||
msgid "Operation Description Warning"
|
||||
msgstr "Aviso da Descrição da Operação"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__remaining_item_qty
|
||||
msgid "Remaining Item Qty"
|
||||
msgstr "Qtd de Itens Restantes"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Remove sidebar button"
|
||||
msgstr "Remover botão da barra lateral"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Security"
|
||||
msgstr "Segurança"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_wizard_mixin__selected_item_qty
|
||||
msgid "Selected Item Qty"
|
||||
msgstr "Qtd de Itens Selecionados"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Settings"
|
||||
msgstr "Configurações"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model:ir.model.fields,field_description:mass_operation_abstract.field_mass_operation_mixin__ref_ir_act_window_id
|
||||
msgid "Sidebar Action"
|
||||
msgstr "Ação da Barra Lateral"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: model_terms:ir.ui.view,arch_db:mass_operation_abstract.view_mass_operation_mixin_form
|
||||
msgid "Technical Informations"
|
||||
msgstr "Informações Técnicas"
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:54
|
||||
#, python-format
|
||||
msgid "The treatment will be processed on the %d selected elements."
|
||||
msgstr "O tratamento será aplicado nos %d elementos selecionados."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:60
|
||||
#, python-format
|
||||
msgid "You have selected %d items that can not be processed. Only %d items will be processed."
|
||||
msgstr ""
|
||||
"Selecionou %d itens que não podem ser processados. Apenas %d itens serão "
|
||||
"processados."
|
||||
|
||||
#. module: mass_operation_abstract
|
||||
#: code:addons/mass_operation_abstract/wizard/mass_operation_wizard_mixin.py:84
|
||||
#, python-format
|
||||
msgid "there is no more element that corresponds to the rules of the domain.\n"
|
||||
" Please refresh your list and try to select again the items."
|
||||
msgstr ""
|
||||
"não há mais elementos que correspondam às regras do domínio.\n"
|
||||
" Por favor, refresque a sua lista e tente selecionar novamente os itens."
|
1
mass_operation_abstract/models/__init__.py
Normal file
1
mass_operation_abstract/models/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import mass_operation_mixin
|
101
mass_operation_abstract/models/mass_operation_mixin.py
Normal file
101
mass_operation_abstract/models/mass_operation_mixin.py
Normal file
|
@ -0,0 +1,101 @@
|
|||
# Copyright (C) 2018 - 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).
|
||||
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class MassOperationMixin(models.AbstractModel):
|
||||
_name = "mass.operation.mixin"
|
||||
_description = "Abstract Mass Operations"
|
||||
|
||||
# To Overwrite Section (Mandatory)
|
||||
_wizard_model_name = False
|
||||
|
||||
# To Overwrite Section (Optional)
|
||||
def _prepare_action_name(self):
|
||||
return _("Mass Operation (%s)" % (self.name))
|
||||
|
||||
def _get_model_domain(self):
|
||||
return [("transient", "=", False)]
|
||||
|
||||
# Column Section
|
||||
name = fields.Char(string="Name", required=True)
|
||||
|
||||
action_name = fields.Char(string="Action Name", required=True)
|
||||
|
||||
message = fields.Text(
|
||||
string="Message",
|
||||
help="If set, this message will be displayed in the" " wizard.",
|
||||
)
|
||||
|
||||
model_id = fields.Many2one(
|
||||
comodel_name="ir.model",
|
||||
string="Model",
|
||||
required=True,
|
||||
ondelete="cascade",
|
||||
domain=lambda s: s._get_model_domain(),
|
||||
)
|
||||
|
||||
ref_ir_act_window_id = fields.Many2one(
|
||||
comodel_name="ir.actions.act_window",
|
||||
string="Sidebar Action",
|
||||
readonly=True,
|
||||
copy=False,
|
||||
)
|
||||
|
||||
group_ids = fields.Many2many(
|
||||
comodel_name="res.groups",
|
||||
relation="mass_group_rel",
|
||||
column1="mass_id",
|
||||
column2="group_id",
|
||||
string="Allowed Groups",
|
||||
)
|
||||
|
||||
domain = fields.Char(string="Domain", required=True, default="[]")
|
||||
|
||||
# Onchange Section
|
||||
@api.onchange("name")
|
||||
def onchange_name(self):
|
||||
if self.name and not self.action_name:
|
||||
self.action_name = self._prepare_action_name()
|
||||
|
||||
# Action Section
|
||||
def enable_mass_operation(self):
|
||||
action_obj = self.env["ir.actions.act_window"]
|
||||
for mixin in self:
|
||||
if not mixin.ref_ir_act_window_id:
|
||||
mixin.ref_ir_act_window_id = action_obj.create(mixin._prepare_action())
|
||||
|
||||
def disable_mass_operation(self):
|
||||
self.mapped("ref_ir_act_window_id").unlink()
|
||||
|
||||
# Overload Section
|
||||
def unlink(self):
|
||||
self.disable_mass_operation()
|
||||
return super().unlink()
|
||||
|
||||
def copy(self, default=None):
|
||||
default = default or {}
|
||||
default.update({"name": _("%s (copy)") % self.name})
|
||||
return super().copy(default=default)
|
||||
|
||||
# Private Section
|
||||
def _prepare_action(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"name": self.action_name,
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": self._wizard_model_name,
|
||||
"groups_id": [(6, 0, self.group_ids.ids)],
|
||||
"context": """{
|
||||
'mass_operation_mixin_id' : %d,
|
||||
'mass_operation_mixin_name' : '%s',
|
||||
}"""
|
||||
% (self.id, self._name),
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
"binding_model_id": self.model_id.id,
|
||||
"binding_type": "action",
|
||||
}
|
1
mass_operation_abstract/readme/CONTRIBUTORS.rst
Normal file
1
mass_operation_abstract/readme/CONTRIBUTORS.rst
Normal file
|
@ -0,0 +1 @@
|
|||
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
|
2
mass_operation_abstract/readme/DESCRIPTION.rst
Normal file
2
mass_operation_abstract/readme/DESCRIPTION.rst
Normal file
|
@ -0,0 +1,2 @@
|
|||
This module provides generic tools to develop modules that process mass
|
||||
operations on any models.
|
7
mass_operation_abstract/readme/ROADMAP.rst
Normal file
7
mass_operation_abstract/readme/ROADMAP.rst
Normal file
|
@ -0,0 +1,7 @@
|
|||
* refactor ``mass_editing`` and ``mass_sorting`` OCA modules to depend on
|
||||
this module.
|
||||
|
||||
* Develop new modules like:
|
||||
|
||||
1. ``mass_scripting`` to have the possibility to execute custom python code
|
||||
on any model, for selected items.
|
BIN
mass_operation_abstract/static/description/icon.png
Normal file
BIN
mass_operation_abstract/static/description/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
433
mass_operation_abstract/static/description/index.html
Normal file
433
mass_operation_abstract/static/description/index.html
Normal file
|
@ -0,0 +1,433 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Mass Operation Abstract</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="mass-operation-abstract">
|
||||
<h1 class="title">Mass Operation Abstract</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/mass_operation_abstract"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-mass_operation_abstract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module provides generic tools to develop modules that process mass
|
||||
operations on any models.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#known-issues-roadmap" id="id1">Known issues / Roadmap</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="known-issues-roadmap">
|
||||
<h1><a class="toc-backref" href="#id1">Known issues / Roadmap</a></h1>
|
||||
<ul class="simple">
|
||||
<li>refactor <tt class="docutils literal">mass_editing</tt> and <tt class="docutils literal">mass_sorting</tt> OCA modules to depend on
|
||||
this module.</li>
|
||||
<li>Develop new modules like:</li>
|
||||
</ul>
|
||||
<ol class="arabic simple">
|
||||
<li><tt class="docutils literal">mass_scripting</tt> to have the possibility to execute custom python code
|
||||
on any model, for selected items.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20mass_operation_abstract%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id3">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id4">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>GRAP</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Sylvain LE GAL (<a class="reference external" href="https://www.twitter.com/legalsylvain">https://www.twitter.com/legalsylvain</a>)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/mass_operation_abstract">OCA/server-ux</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
16
mass_operation_abstract/views/menu.xml
Normal file
16
mass_operation_abstract/views/menu.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018-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>
|
||||
|
||||
<menuitem id="menu_mass_operation"
|
||||
name="Mass Operations"
|
||||
parent="base.menu_administration" sequence="11"/>
|
||||
|
||||
<!-- base.menu_custom -->
|
||||
|
||||
</odoo>
|
83
mass_operation_abstract/views/view_mass_operation_mixin.xml
Normal file
83
mass_operation_abstract/views/view_mass_operation_mixin.xml
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018-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>
|
||||
|
||||
<record id="view_mass_operation_mixin_search" model="ir.ui.view">
|
||||
<field name="model">mass.operation.mixin</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_ids"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mass_operation_mixin_tree" model="ir.ui.view">
|
||||
<field name="model">mass.operation.mixin</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-muted="(ref_ir_act_window_id == False)">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_ids"/>
|
||||
<field name="ref_ir_act_window_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mass_operation_mixin_form" model="ir.ui.view">
|
||||
<field name="model">mass.operation.mixin</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button name="enable_mass_operation" type="object"
|
||||
icon="fa-plus"
|
||||
class="btn btn-primary" string="Add sidebar button"
|
||||
attrs="{'invisible':[('ref_ir_act_window_id', '!=', False)]}"
|
||||
help="Display a button in the sidebar of related model to open a wizard"/>
|
||||
<button name="disable_mass_operation" type="object"
|
||||
icon="fa-minus"
|
||||
class="btn btn-default" string="Remove sidebar button"
|
||||
attrs="{'invisible':[('ref_ir_act_window_id', '=', False)]}"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only"><label for="name"/></div>
|
||||
<h1><field name="name"/></h1>
|
||||
<div class="oe_edit_only"><label for="action_name"/></div>
|
||||
<h2><field name="action_name"
|
||||
attrs="{'readonly': [('ref_ir_act_window_id', '!=', False)]}"/></h2>
|
||||
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="model_id" attrs="{'readonly': [('ref_ir_act_window_id', '!=', False)]}"/>
|
||||
<field name="domain" attrs="{'readonly': [('ref_ir_act_window_id', '!=', False)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="message"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="setting" string="Settings" />
|
||||
<!-- Placeholder to use in inherited view, to insert custom settings-->
|
||||
<page name="technical" string="Technical Informations">
|
||||
<group>
|
||||
<field name="ref_ir_act_window_id" attrs="{'invisible':[('ref_ir_act_window_id', '=', False)]}"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Security">
|
||||
<field name="group_ids" nolabel="1" attrs="{'readonly': [('ref_ir_act_window_id', '!=', False)]}"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (C) 2018-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>
|
||||
|
||||
<record id="view_mass_operation_wizard_mixin_form" model="ir.ui.view">
|
||||
<field name="model">mass.operation.wizard.mixin</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header/>
|
||||
<p class="oe_grey" attrs="{'invisible':
|
||||
[('message', '=', False)]}">
|
||||
<field name="message"/>
|
||||
|
||||
</p>
|
||||
<p class="alert alert-info" role="alert" attrs="{'invisible':
|
||||
[('operation_description_info', '=', False)]}">
|
||||
<field name="operation_description_info"/>
|
||||
</p>
|
||||
|
||||
<p class="alert alert-warning" role="alert" attrs="{'invisible':
|
||||
[('operation_description_warning', '=', False)]}">
|
||||
<field name="operation_description_warning"/>
|
||||
</p>
|
||||
|
||||
<p class="alert alert-danger" role="alert" attrs="{'invisible': [('operation_description_danger', '=', False)]}">
|
||||
<field name="operation_description_danger"/>
|
||||
</p>
|
||||
|
||||
<group name="custom_info">
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Apply" name="button_apply" type="object" class="oe_highlight"/>
|
||||
<button string="Cancel" class="oe_link" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
1
mass_operation_abstract/wizard/__init__.py
Normal file
1
mass_operation_abstract/wizard/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import mass_operation_wizard_mixin
|
117
mass_operation_abstract/wizard/mass_operation_wizard_mixin.py
Normal file
117
mass_operation_abstract/wizard/mass_operation_wizard_mixin.py
Normal file
|
@ -0,0 +1,117 @@
|
|||
# Copyright (C) 2018 - 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).
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
from odoo.osv import expression
|
||||
from odoo.tools.safe_eval import safe_eval
|
||||
|
||||
|
||||
class MassOperationWizardMixin(models.AbstractModel):
|
||||
_name = "mass.operation.wizard.mixin"
|
||||
_description = "Abstract Mass Operations Wizard"
|
||||
|
||||
_OPERATION_STATUS_SELECTION = [
|
||||
("info", "Info"),
|
||||
("warning", "Warning"),
|
||||
("danger", "Danger"),
|
||||
]
|
||||
|
||||
# To Overwrite Section
|
||||
def _apply_operation(self, items):
|
||||
self.ensure_one()
|
||||
pass
|
||||
|
||||
# Column Section
|
||||
selected_item_qty = fields.Integer(readonly=True)
|
||||
|
||||
remaining_item_qty = fields.Integer(readonly=True)
|
||||
|
||||
operation_description_info = fields.Text(readonly=True)
|
||||
operation_description_warning = fields.Text(readonly=True)
|
||||
operation_description_danger = fields.Text(readonly=True)
|
||||
|
||||
message = fields.Text(readonly=True)
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields):
|
||||
res = super().default_get(fields)
|
||||
|
||||
mass_operation = self._get_mass_operation()
|
||||
|
||||
operation_description_info = False
|
||||
operation_description_warning = False
|
||||
operation_description_danger = False
|
||||
|
||||
# Compute items quantity
|
||||
active_ids = self.env.context.get("active_ids")
|
||||
remaining_items = self._get_remaining_items()
|
||||
|
||||
if len(active_ids) == len(remaining_items):
|
||||
operation_description_info = _(
|
||||
"The treatment will be processed on the %d selected"
|
||||
" elements." % (len(active_ids))
|
||||
)
|
||||
elif len(remaining_items):
|
||||
operation_description_warning = _(
|
||||
"You have selected %d items that can not be processed."
|
||||
" Only %d items will be processed."
|
||||
% (len(active_ids) - len(remaining_items), len(remaining_items))
|
||||
)
|
||||
else:
|
||||
operation_description_danger = _(
|
||||
"None of the %d items you have selected can be processed."
|
||||
% (len(active_ids))
|
||||
)
|
||||
|
||||
res.update(
|
||||
{
|
||||
"selected_item_qty": len(active_ids),
|
||||
"remaining_item_qty": len(remaining_items),
|
||||
"operation_description_info": operation_description_info,
|
||||
"operation_description_warning": operation_description_warning,
|
||||
"operation_description_danger": operation_description_danger,
|
||||
"message": mass_operation.message,
|
||||
}
|
||||
)
|
||||
return res
|
||||
|
||||
def button_apply(self):
|
||||
items = self._get_remaining_items()
|
||||
if not len(items):
|
||||
raise UserError(
|
||||
_(
|
||||
"there is no more element that corresponds to the rules of"
|
||||
" the domain.\n Please refresh your list and try to"
|
||||
" select again the items."
|
||||
)
|
||||
)
|
||||
return self._apply_operation(items)
|
||||
|
||||
# Private Section
|
||||
@api.model
|
||||
def _get_mass_operation(self):
|
||||
IrModel = self.env["ir.model"]
|
||||
mass_operation_models = IrModel.search(
|
||||
[("model", "=", self.env.context.get("mass_operation_mixin_name", False))]
|
||||
)
|
||||
if len(mass_operation_models) != 1:
|
||||
return False
|
||||
MassOperationModel = self.env[mass_operation_models[0].model]
|
||||
return MassOperationModel.search(
|
||||
[("id", "=", self.env.context.get("mass_operation_mixin_id", 0))]
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _get_remaining_items(self):
|
||||
active_ids = self.env.context.get("active_ids", [])
|
||||
mass_operation = self._get_mass_operation()
|
||||
SrcModel = self.env[mass_operation.model_id.model]
|
||||
if mass_operation.domain != "[]":
|
||||
domain = expression.AND(
|
||||
[safe_eval(mass_operation.domain), [("id", "in", active_ids)]]
|
||||
)
|
||||
else:
|
||||
domain = [("id", "in", active_ids)]
|
||||
return SrcModel.search(domain)
|
Loading…
Add table
Add a link
Reference in a new issue