forked from Techsystech/web
[ADD] Ask for confirmation when copying records
[UPD] Update web_copy_confirm.pot [ADD] icon.png16.0
parent
c8808b0be7
commit
088d529896
|
@ -0,0 +1,55 @@
|
||||||
|
.. 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
|
||||||
|
|
||||||
|
=================================================
|
||||||
|
Show a confirmation dialogue when copying records
|
||||||
|
=================================================
|
||||||
|
|
||||||
|
This module will show a confirmation dialog when the user selects the
|
||||||
|
`Duplicate` option from the `More` dropdown in the standard form view.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
|
:alt: Try me on Runbot
|
||||||
|
:target: https://runbot.odoo-community.org/runbot/162/8.0
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Bugs are tracked on `GitHub Issues
|
||||||
|
<https://github.com/OCA/web/issues>`_. In case of trouble, please
|
||||||
|
check there if your issue has already been reported. If you spotted it first,
|
||||||
|
help us smash it by providing detailed and welcomed feedback.
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Images
|
||||||
|
------
|
||||||
|
|
||||||
|
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Stefan Rijnhart <stefan@opener.amsterdam>
|
||||||
|
|
||||||
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
Maintainer
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. 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.
|
|
@ -0,0 +1,19 @@
|
||||||
|
# coding: utf-8
|
||||||
|
# Copyright (C) 2018 DynApps <http://www.dynapps.be>
|
||||||
|
# @author Stefan Rijnhart <stefan@opener.amsterdam>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
{
|
||||||
|
"name": "Show confirmation dialogue before copying records",
|
||||||
|
"version": "8.0.1.0.0",
|
||||||
|
"author": "Dynapps,Odoo Community Association (OCA)",
|
||||||
|
"website": "https://github.com/OCA/web",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"category": "Tools",
|
||||||
|
"depends": [
|
||||||
|
'web',
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
"views/assets.xml",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_copy_confirm
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 8.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"Last-Translator: <>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
|
#. module: web_copy_confirm
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_copy_confirm/static/src/js/web_copy_confirm.js:9
|
||||||
|
#, python-format
|
||||||
|
msgid "Do you really want to copy this record?"
|
||||||
|
msgstr ""
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright (C) 2018 DynApps <http://www.dynapps.be>
|
||||||
|
// @author Stefan Rijnhart <stefan@opener.amsterdam>
|
||||||
|
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
openerp.web_copy_confirm = function(instance) {
|
||||||
|
instance.web.FormView.include({
|
||||||
|
on_button_duplicate: function() {
|
||||||
|
var self = this;
|
||||||
|
this.has_been_loaded.done(function() {
|
||||||
|
if (confirm(_t("Do you really want to copy this record?"))) {
|
||||||
|
return self._super.apply(self, arguments);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp><data>
|
||||||
|
|
||||||
|
<template id="assets_backend" name="web_copy_confirm assets" inherit_id="web.assets_backend">
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<script type="text/javascript" src="/web_copy_confirm/static/src/js/web_copy_confirm.js"></script>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</data></openerp>
|
Loading…
Reference in New Issue