diff --git a/web_digital_sign/LICENSE/LICENSE b/web_digital_sign/LICENSE/LICENSE deleted file mode 100644 index ab881729..00000000 --- a/web_digital_sign/LICENSE/LICENSE +++ /dev/null @@ -1,17 +0,0 @@ - OpenERP, Open Source Management Solution - Copyright (C) 2004-2010 OpenERP SA () - Copyright (C) 2011-2015 Serpent Consulting Services Pvt. Ltd. (). - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - diff --git a/web_digital_sign/__init__.py b/web_digital_sign/__init__.py deleted file mode 100644 index b597d73a..00000000 --- a/web_digital_sign/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. -import users - diff --git a/web_digital_sign/__openerp__.py b/web_digital_sign/__openerp__.py deleted file mode 100644 index 1b0cd679..00000000 --- a/web_digital_sign/__openerp__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# See LICENSE file for full copyright and licensing details. -{ - "name" : "Web Digital Signature 9.0", - "version" : "9.0.1.0.0", - 'author': 'Serpent Consulting Services Pvt. Ltd.', - "category": '', - 'license': 'AGPL-3', - 'complexity': "easy", - 'depends': ['web'], - 'description': ''' - This module provides the functionality to store digital signature - for a record. - -> This module is helpfull to make your business process a little - bit more faster & makes it more user friendly by providing you - digital signature functionality on your documents. - -> It is touch screen enable so user can add signature with touch - devices. - -> Digital signature can be very usefull for documents such as - sale orders, purchase orders, inovoices, payslips, procurement - receipts, etc. - The example can be seen into the User's form view where we have - added a test field under signature. - ''', - 'data': [ - 'views/we_digital_sign_view.xml', - 'users_view.xml' - ], - 'website': 'http://www.serpentcs.com', - 'qweb': ['static/src/xml/digital_sign.xml'], - 'installable': True, - 'auto_install': False, -} - diff --git a/web_digital_sign/static/description/icon.png b/web_digital_sign/static/description/icon.png deleted file mode 100644 index d15532dd..00000000 Binary files a/web_digital_sign/static/description/icon.png and /dev/null differ diff --git a/web_digital_sign/static/description/img/1.png b/web_digital_sign/static/description/img/1.png deleted file mode 100644 index fa633751..00000000 Binary files a/web_digital_sign/static/description/img/1.png and /dev/null differ diff --git a/web_digital_sign/static/description/img/2.png b/web_digital_sign/static/description/img/2.png deleted file mode 100644 index 39f2775f..00000000 Binary files a/web_digital_sign/static/description/img/2.png and /dev/null differ diff --git a/web_digital_sign/static/description/img/3.png b/web_digital_sign/static/description/img/3.png deleted file mode 100644 index 4bb84b43..00000000 Binary files a/web_digital_sign/static/description/img/3.png and /dev/null differ diff --git a/web_digital_sign/static/description/index.html b/web_digital_sign/static/description/index.html deleted file mode 100644 index d8b7f323..00000000 --- a/web_digital_sign/static/description/index.html +++ /dev/null @@ -1,68 +0,0 @@ -
-
-
-

Web Digital Signature

-

This module provides the functionality to store digital signature for a record

-
    -
  • This module is helpfull to make your business process a little bit more faster & makes it more user friendly by providing you digital signature functionality on your documents.
  • -
  • It is touch screen enable so user can add signature with touch devices.
  • -
  • Digital signature can be very usefull for documents such as sale orders, purchase orders, inovoices, payslips, procurement receipts, etc.
  • -
-
-
-

-

Usage

-

To use this module, you need to add widget="signature" to your binary field in your view.

- -
-
-
-
-
-

-

Digital Signature View

-

User can store their digital signature - in the binary field, as you can see image. -

-
-
- -
-
-
-
-
-
-
-
- -
-
-
-

Draw Signature

-

As shown in the image, user can add a signature using mouse, pen, or finger.

-
-
-
-
-
-
-

Clear Digital Signature

-

User can clear signature using clear button and it will re-initialize the signature.

-
-
-
- -
-
-
-
- - -
-

For any questions, support and development

-

- -  Contact Us  -

-
diff --git a/web_digital_sign/users.py b/web_digital_sign/users.py deleted file mode 100644 index 3e18fa92..00000000 --- a/web_digital_sign/users.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp import models, fields, api - -class Users(models.Model): - _name = 'res.users' - _inherit = 'res.users' - - signature= fields.Binary(string='Signature') - diff --git a/web_digital_sign/users_view.xml b/web_digital_sign/users_view.xml deleted file mode 100644 index 40bd5c5d..00000000 --- a/web_digital_sign/users_view.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - inherited.res.users.form - res.users - - - - - - - - - diff --git a/web_digital_sign/views/we_digital_sign_view.xml b/web_digital_sign/views/we_digital_sign_view.xml deleted file mode 100644 index ef98dd96..00000000 --- a/web_digital_sign/views/we_digital_sign_view.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/web_widget_digitized_signature/README.rst b/web_widget_digitized_signature/README.rst new file mode 100644 index 00000000..53c47a52 --- /dev/null +++ b/web_widget_digitized_signature/README.rst @@ -0,0 +1,70 @@ +.. 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 + +======================= +Web Digitized Signature +======================= + +This module provides a widget for binary fields that allows to digitize a +signature and store it as an image. + +As demonstration, it includes this widget at user level, so that we can store +a signature image for each user. + +Configuration +============= + +#. To use this module, you need to add ``widget="signature"`` to your binary + field in your view. +#. You can specifify signature dimensions like the following: + ```` + +Usage +===== + +#. Go to *Settings > Users > Users*. +#. Open one of the existing users. +#. You can set a digital signature for it on the field "Signature". + + +.. 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/9.0 + +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. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Jay Vora +* Vicent Cubells + +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. diff --git a/web_widget_digitized_signature/__init__.py b/web_widget_digitized_signature/__init__.py new file mode 100644 index 00000000..96b2d789 --- /dev/null +++ b/web_widget_digitized_signature/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-2010 OpenERP SA () +# Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/web_widget_digitized_signature/__openerp__.py b/web_widget_digitized_signature/__openerp__.py new file mode 100644 index 00000000..1f61492d --- /dev/null +++ b/web_widget_digitized_signature/__openerp__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-2010 OpenERP SA () +# Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd. +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Web Widget Digitized Signature", + "version": "9.0.1.0.0", + "author": "Serpent Consulting Services Pvt. Ltd., " + "Agile Business Group, " + "Tecnativa, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": 'Web', + 'depends': [ + 'web', + 'mail', + ], + 'data': [ + 'views/web_digital_sign_view.xml', + 'views/res_users_view.xml', + ], + 'website': 'http://www.serpentcs.com', + 'qweb': [ + 'static/src/xml/digital_sign.xml', + ], + 'installable': True, +} diff --git a/web_widget_digitized_signature/i18n/es.po b/web_widget_digitized_signature/i18n/es.po new file mode 100644 index 00000000..0f1120bf --- /dev/null +++ b/web_widget_digitized_signature/i18n/es.po @@ -0,0 +1,79 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_widget_digitized_signature +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-11 04:42+0000\n" +"PO-Revision-Date: 2017-07-11 04:42+0000\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_widget_digitized_signature +#. openerp-web +#: code:addons/web_widget_digitized_signature/static/src/xml/digital_sign.xml:7 +#, python-format +msgid "Clear" +msgstr "Limpiar" + +#. module: web_widget_digitized_signature +#. openerp-web +#: code:addons/web_widget_digitized_signature/static/src/js/digital_sign.js:81 +#, python-format +msgid "Could not display the selected image." +msgstr "No se puede mostrar la imagen seleccionada." + +#. module: web_widget_digitized_signature +#: code:addons/web_widget_digitized_signature/models/mail_thread.py:26 +#, python-format +msgid "Deletion date: %s" +msgstr "Fecha de eliminaciĆ³n: %s" + +#. module: web_widget_digitized_signature +#. openerp-web +#: code:addons/web_widget_digitized_signature/static/src/xml/digital_sign.xml:10 +#, python-format +msgid "Draw your signature" +msgstr "Dibuje su firma" + +#. module: web_widget_digitized_signature +#. openerp-web +#: code:addons/web_widget_digitized_signature/static/src/js/digital_sign.js:81 +#, python-format +msgid "Image" +msgstr "Imagen" + +#. module: web_widget_digitized_signature +#: model:ir.model.fields,field_description:web_widget_digitized_signature.field_res_users_signature_image +msgid "Signature" +msgstr "Firma" + +#. module: web_widget_digitized_signature +#: code:addons/web_widget_digitized_signature/models/mail_thread.py:23 +#, python-format +msgid "Signature date: %s" +msgstr "Fecha de la firma: %s" + +#. module: web_widget_digitized_signature +#: code:addons/web_widget_digitized_signature/models/mail_thread.py:21 +#, python-format +msgid "Signature has been created." +msgstr "La firma se ha creado." + +#. module: web_widget_digitized_signature +#: code:addons/web_widget_digitized_signature/models/mail_thread.py:25 +#, python-format +msgid "Signature has been deleted." +msgstr "La firma se ha eliminado." + +#. module: web_widget_digitized_signature +#: model:ir.model,name:web_widget_digitized_signature.model_res_users +msgid "Users" +msgstr "Usuarios" + diff --git a/web_widget_digitized_signature/models/__init__.py b/web_widget_digitized_signature/models/__init__.py new file mode 100644 index 00000000..3f2b1438 --- /dev/null +++ b/web_widget_digitized_signature/models/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-2010 OpenERP SA () +# Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import mail_thread +from . import res_users diff --git a/web_widget_digitized_signature/models/mail_thread.py b/web_widget_digitized_signature/models/mail_thread.py new file mode 100644 index 00000000..63b84251 --- /dev/null +++ b/web_widget_digitized_signature/models/mail_thread.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-2010 OpenERP SA () +# Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd. +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import base64 +from openerp import _, models, fields + + +class MailThread(models.Model): + _inherit = "mail.thread" + + def _track_signature(self, values, field): + """ This method allows to track creation and deletion of signature + field. You must call this method in order to display a message + in the chatter with information of the changes in the signature. + + :param values: a dict with the values being written + :param field: name of the field that must be tracked + """ + if field in values: + attachments = [] + messages = [] + if values.get(field): + content = base64.b64decode(values.get(field)) + attachments = [('signature', content)] + messages.append(_('Signature has been created.')) + messages.append( + _('Signature date: %s' % fields.Datetime.now())) + else: + messages.append(_('Signature has been deleted.')) + messages.append(_('Deletion date: %s' % fields.Datetime.now())) + msg_body = '
    ' + for message in messages: + msg_body += '
  • ' + msg_body += message + msg_body += '
  • ' + msg_body += '
' + self.message_post(body=msg_body, attachments=attachments) diff --git a/web_widget_digitized_signature/models/res_users.py b/web_widget_digitized_signature/models/res_users.py new file mode 100644 index 00000000..c1275b66 --- /dev/null +++ b/web_widget_digitized_signature/models/res_users.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2004-2010 OpenERP SA () +# Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd. +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields + + +class Users(models.Model): + _name = 'res.users' + _inherit = 'res.users' + + signature_image = fields.Binary( + string='Signature', + ) diff --git a/web_widget_digitized_signature/static/description/icon.png b/web_widget_digitized_signature/static/description/icon.png new file mode 100644 index 00000000..a7705528 Binary files /dev/null and b/web_widget_digitized_signature/static/description/icon.png differ diff --git a/web_digital_sign/static/lib/jSignature/jSignatureCustom.js b/web_widget_digitized_signature/static/lib/jSignature/jSignatureCustom.js similarity index 100% rename from web_digital_sign/static/lib/jSignature/jSignatureCustom.js rename to web_widget_digitized_signature/static/lib/jSignature/jSignatureCustom.js diff --git a/web_digital_sign/static/src/js/digital_sign.js b/web_widget_digitized_signature/static/src/js/digital_sign.js similarity index 98% rename from web_digital_sign/static/src/js/digital_sign.js rename to web_widget_digitized_signature/static/src/js/digital_sign.js index f40c68d7..468a644a 100644 --- a/web_digital_sign/static/src/js/digital_sign.js +++ b/web_widget_digitized_signature/static/src/js/digital_sign.js @@ -1,4 +1,4 @@ -odoo.define('web_digital_sign.web_digital_sign', function(require) { +odoo.define('web_widget_digitized_signature.web_digital_sign', function(require) { "use strict"; var core = require('web.core'); diff --git a/web_digital_sign/static/src/xml/digital_sign.xml b/web_widget_digitized_signature/static/src/xml/digital_sign.xml similarity index 94% rename from web_digital_sign/static/src/xml/digital_sign.xml rename to web_widget_digitized_signature/static/src/xml/digital_sign.xml index 0fe6c0be..df4e8e22 100644 --- a/web_digital_sign/static/src/xml/digital_sign.xml +++ b/web_widget_digitized_signature/static/src/xml/digital_sign.xml @@ -1,5 +1,5 @@ - + diff --git a/web_widget_digitized_signature/views/res_users_view.xml b/web_widget_digitized_signature/views/res_users_view.xml new file mode 100644 index 00000000..3971c209 --- /dev/null +++ b/web_widget_digitized_signature/views/res_users_view.xml @@ -0,0 +1,27 @@ + + + + + inherited.res.users.form + res.users + + + + + + + + res.users.preferences.form + res.users + + + + + + + + diff --git a/web_widget_digitized_signature/views/web_digital_sign_view.xml b/web_widget_digitized_signature/views/web_digital_sign_view.xml new file mode 100644 index 00000000..4331c08c --- /dev/null +++ b/web_widget_digitized_signature/views/web_digital_sign_view.xml @@ -0,0 +1,11 @@ + + + + + +