[ADD]ADD web_digital_sign,base_copy_user_access
|
|
@ -0,0 +1,104 @@
|
||||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
||||||
|
:target: https://www.gnu.org/licenses/agpl
|
||||||
|
:alt: License: AGPL-3
|
||||||
|
|
||||||
|
=====================
|
||||||
|
Base Copy User Access
|
||||||
|
=====================
|
||||||
|
|
||||||
|
This Module allows the administrator to copy user access from one user to many users.
|
||||||
|
|
||||||
|
This Module created a wizard that can be access on "Action" button in Settings > Users > Users & Companies.
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
To install this module, you need to:
|
||||||
|
|
||||||
|
1. Clone the branch 14.0 of the repository https://github.com/open-synergy/opnsynid-server-tools
|
||||||
|
2. Add the path to this repository in your configuration (addons-path)
|
||||||
|
3. Update the module list
|
||||||
|
4. Go to menu *Apps -> Apps -> Main Apps*
|
||||||
|
5. Search For *Base Copy User Access*
|
||||||
|
6. Install the module
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
To use this module, you need to:
|
||||||
|
- Go to menu Settings > Users > Users & Companies
|
||||||
|
- Select Users on the list of tree view
|
||||||
|
- Click "Action" button on the top
|
||||||
|
- Click "Copy User Access"
|
||||||
|
- Select the user on the selection
|
||||||
|
- Click "Copy"
|
||||||
|
|
||||||
|
Use Case
|
||||||
|
========
|
||||||
|
"User-A" is a users who have access as manager sales and accounting.
|
||||||
|
Administrator asked to make another two users who has the right equal access with User-A.
|
||||||
|
The two new users was named "User-B" and "User-C"
|
||||||
|
|
||||||
|
So administrator have to do:
|
||||||
|
|
||||||
|
- Without module Base Copy User Access is installed:
|
||||||
|
* Check user access of User-A
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Find the User-A and opened it
|
||||||
|
* Create a new User and named it User-B
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Create the User-B
|
||||||
|
* Set up the access of User-B that has the right equal access with User-A
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Find the User-B and opened it
|
||||||
|
+ Fill user access of User-B according with user access of User-A
|
||||||
|
* Create a new User and named it User-C
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Create the User-C
|
||||||
|
* Set up the access of User-C that has the right equal access with User-A
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Find the User-C and opened it
|
||||||
|
+ Fill user access of User-C according with user access of User-A
|
||||||
|
|
||||||
|
- With module Base Copy User Access is installed:
|
||||||
|
* Create a new User and named it User-B
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Create the User-B
|
||||||
|
* Create a new User and named it User-C
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Create the User-C
|
||||||
|
* Copy user access of User-A to User-B and User-C
|
||||||
|
+ Go to menu Settings > Users > Users
|
||||||
|
+ Select User-A and User-B on the list of tree view
|
||||||
|
+ Click "More" button on the top
|
||||||
|
+ Click "Copy User Access"
|
||||||
|
+ The wizard will show up and then fill the user with User-A
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Bugs are tracked on `GitHub Issues
|
||||||
|
<https://github.com/open-synergy/opnsynid-server-tools/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
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Nur Azmi <azmimr67@gmail.com>
|
||||||
|
* Michael Viriyananda <viriyananda.michael@gmail.com>
|
||||||
|
* Andhitia Rama <andhitia.r@gmail.com>
|
||||||
|
|
||||||
|
Maintainer
|
||||||
|
----------
|
||||||
|
|
||||||
|
.. image:: https://simetri-sinergi.id/logo.png
|
||||||
|
:alt: PT. Simetri Sinergi Indonesia
|
||||||
|
:target: https://simetri-sinergi.id.com
|
||||||
|
|
||||||
|
This module is maintained by the PT. Simetri Sinergi Indonesia.
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright 2022 OpenSynergy Indonesia
|
||||||
|
# Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import wizards
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Copyright 2022 OpenSynergy Indonesia
|
||||||
|
# Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
# pylint: disable=locally-disabled, manifest-required-author
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Base Copy User Access",
|
||||||
|
"version": "14.0.1.0.1",
|
||||||
|
"summary": "Copy access right from another user",
|
||||||
|
"author": "PT. Simetri Sinergi Indonesia,OpenSynergy Indonesia",
|
||||||
|
"category": "Generic Modules/Base",
|
||||||
|
"website": "https://simetri-sinergi.id",
|
||||||
|
"depends": ["base"],
|
||||||
|
"data": [
|
||||||
|
"wizards/base_copy_user_access.xml",
|
||||||
|
"security/ir.model.access.csv",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
"application": False,
|
||||||
|
"license": "AGPL-3",
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * base_copy_user_access
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2023-07-06 10:43+0000\n"
|
||||||
|
"PO-Revision-Date: 2023-07-06 12:30+0000\n"
|
||||||
|
"Last-Translator: Weblate Admin <odoo@simetri-sinergi.xyz>\n"
|
||||||
|
"Language-Team: Indonesian <http://weblate.simetri-sinergi.xyz/projects/"
|
||||||
|
"opnsynid-server-tools-14-0/opnsynid-server-tools-14-0-base_copy_user_access/"
|
||||||
|
"id/>\n"
|
||||||
|
"Language: id\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
"X-Generator: Weblate 4.18.2\n"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model_terms:ir.ui.view,arch_db:base_copy_user_access.base_copy_user_access_view_form
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Batal"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model_terms:ir.ui.view,arch_db:base_copy_user_access.base_copy_user_access_view_form
|
||||||
|
msgid "Copy"
|
||||||
|
msgstr "Salin"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model_terms:ir.ui.view,arch_db:base_copy_user_access.base_copy_user_access_view_form
|
||||||
|
msgid "Copy Access Right From User"
|
||||||
|
msgstr "Salin Akses Dari Pengguna"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.actions.act_window,name:base_copy_user_access.base_copy_user_access_action
|
||||||
|
msgid "Copy User Access"
|
||||||
|
msgstr "Salin Akses Pengguna"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__create_uid
|
||||||
|
msgid "Created by"
|
||||||
|
msgstr "Dibuat Oleh"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__create_date
|
||||||
|
msgid "Created on"
|
||||||
|
msgstr "Dibuat Pada"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__display_name
|
||||||
|
msgid "Display Name"
|
||||||
|
msgstr "Nama Tempilan"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__id
|
||||||
|
msgid "ID"
|
||||||
|
msgstr "Indonesia"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access____last_update
|
||||||
|
msgid "Last Modified on"
|
||||||
|
msgstr "Disunting Terakhir Pada"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__write_uid
|
||||||
|
msgid "Last Updated by"
|
||||||
|
msgstr "Disunting Terakhir Oleh"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__write_date
|
||||||
|
msgid "Last Updated on"
|
||||||
|
msgstr "Dimodifikasi Terakhir Pada"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model.fields,field_description:base_copy_user_access.field_base_copy_user_access__user_id
|
||||||
|
msgid "User"
|
||||||
|
msgstr "Pengguna"
|
||||||
|
|
||||||
|
#. module: base_copy_user_access
|
||||||
|
#: model:ir.model,name:base_copy_user_access.model_base_copy_user_access
|
||||||
|
msgid "Wizard Copy User Access"
|
||||||
|
msgstr "Salin Akses Pengguna"
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
access_base_copy_user_access_all,base.copy_user_access - All user ,model_base_copy_user_access,,1,1,1,1
|
||||||
|
|
After Width: | Height: | Size: 47 KiB |
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright 2022 OpenSynergy Indonesia
|
||||||
|
# Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import test_copy_user_access
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
# © 2016 OpenSynergy Indonesia
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from lxml import etree
|
||||||
|
|
||||||
|
from odoo.tests.common import TransactionCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestCopyUserAccess(TransactionCase):
|
||||||
|
def setUp(self, *args, **kwargs):
|
||||||
|
super(TestCopyUserAccess, self).setUp(*args, **kwargs)
|
||||||
|
|
||||||
|
# Objects
|
||||||
|
self.obj_res_users = self.env["res.users"]
|
||||||
|
self.obj_wizard = self.env["base.copy_user_access"]
|
||||||
|
|
||||||
|
# Data
|
||||||
|
self.demo_user = self.env.ref("base.user_demo")
|
||||||
|
|
||||||
|
def _prepare_user_data(self):
|
||||||
|
data = {"login": "test_user@test.com", "name": "test lagi", "password": "a"}
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def test_copy_user_access(self):
|
||||||
|
# Create New User
|
||||||
|
data = self._prepare_user_data()
|
||||||
|
user = self.obj_res_users.create(data)
|
||||||
|
# Check create new user
|
||||||
|
self.assertIsNotNone(user)
|
||||||
|
|
||||||
|
# Fill Context
|
||||||
|
context = self.obj_res_users.context_get()
|
||||||
|
ctx = context.copy()
|
||||||
|
ctx.update({"active_ids": user.ids})
|
||||||
|
|
||||||
|
# Create Wizard
|
||||||
|
wizard = self.obj_wizard.with_context(ctx).create(
|
||||||
|
{"user_id": self.demo_user.id}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check fields_view_get
|
||||||
|
view = wizard.fields_view_get()
|
||||||
|
|
||||||
|
doc = etree.XML(view["arch"])
|
||||||
|
for node in doc.xpath("//field[@name='user_id']"):
|
||||||
|
domain = node.get("domain")
|
||||||
|
test_domain = "[('id', 'not in', " + str(user.ids) + ")]"
|
||||||
|
self.assertEquals(domain, test_domain)
|
||||||
|
|
||||||
|
# Check group_ids(new_user) with group_ids(demo_user)
|
||||||
|
wizard.with_context(ctx).copy_access_right()
|
||||||
|
self.assertEquals(set(self.demo_user.groups_id.ids), set(user.groups_id.ids))
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright 2022 OpenSynergy Indonesia
|
||||||
|
# Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import base_copy_user_access
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
# Copyright 2022 OpenSynergy Indonesia
|
||||||
|
# Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from lxml import etree
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class WizardBaseCopyUserAccess(models.TransientModel):
|
||||||
|
_name = "base.copy_user_access"
|
||||||
|
_description = "Wizard Copy User Access"
|
||||||
|
|
||||||
|
user_id = fields.Many2one(string="User", comodel_name="res.users", required=True)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def fields_view_get(
|
||||||
|
self, view_id=None, view_type="form", toolbar=False, submenu=False
|
||||||
|
):
|
||||||
|
res = super(WizardBaseCopyUserAccess, self).fields_view_get(
|
||||||
|
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu
|
||||||
|
)
|
||||||
|
doc = etree.XML(res["arch"])
|
||||||
|
for node in doc.xpath("//field[@name='user_id']"):
|
||||||
|
active_ids = self._context.get("active_ids")
|
||||||
|
domain = "[('id', 'not in', " + str(active_ids) + ")]"
|
||||||
|
node.set("domain", domain)
|
||||||
|
res["arch"] = etree.tostring(doc)
|
||||||
|
return res
|
||||||
|
|
||||||
|
def copy_access_right(self):
|
||||||
|
res = []
|
||||||
|
self.ensure_one()
|
||||||
|
|
||||||
|
obj_user = self.env["res.users"]
|
||||||
|
|
||||||
|
context = self._context
|
||||||
|
record_id = context["active_ids"]
|
||||||
|
|
||||||
|
user = obj_user.browse(self.user_id.id)
|
||||||
|
|
||||||
|
for group in user.groups_id:
|
||||||
|
res.append(group.id)
|
||||||
|
|
||||||
|
for data in record_id:
|
||||||
|
user_id = obj_user.browse(data)
|
||||||
|
vals = {
|
||||||
|
"groups_id": [(6, 0, res)],
|
||||||
|
}
|
||||||
|
|
||||||
|
user_id.write(vals)
|
||||||
|
|
||||||
|
return {"type": "ir.actions.act_window_close"}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!-- Copyright 2022 OpenSynergy Indonesia
|
||||||
|
Copyright 2022 PT. Simetri Sinergi Indonesia
|
||||||
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<record id="base_copy_user_access_view_form" model="ir.ui.view">
|
||||||
|
<field name="name">Copy User Access</field>
|
||||||
|
<field name="model">base.copy_user_access</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Copy Access Right From User">
|
||||||
|
<group colspan="4" cols="2">
|
||||||
|
<field name="user_id" required="True" />
|
||||||
|
</group>
|
||||||
|
<footer>
|
||||||
|
<button
|
||||||
|
name="copy_access_right"
|
||||||
|
string="Copy"
|
||||||
|
type="object"
|
||||||
|
class="oe_highlight"
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
string="Cancel"
|
||||||
|
class="btn btn-secondary"
|
||||||
|
special="cancel"
|
||||||
|
/>
|
||||||
|
</footer>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="base_copy_user_access_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Copy User Access</field>
|
||||||
|
<field name="res_model">base.copy_user_access</field>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="view_id" ref="base_copy_user_access_view_form" />
|
||||||
|
<field name="target">new</field>
|
||||||
|
<field name="binding_model_id" ref="base.model_res_users" />
|
||||||
|
<field name="binding_view_types">list,form</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
OpenERP, Open Source Management Solution
|
||||||
|
Copyright (C) 2011-TODAY Serpent Consulting Services Pvt. Ltd.
|
||||||
|
(<http://www.serpentcs.com>).
|
||||||
|
|
||||||
|
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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
=================
|
||||||
|
Web Digital Sign
|
||||||
|
=================
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
* User can store their digital signature in the binary field, as you can see image.
|
||||||
|
|
||||||
|
* As shown in the image, user can add a signature using mouse, pen, or finger.
|
||||||
|
|
||||||
|
* User can clear signature using clear button and it will re-initialize the signature.
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
|
||||||
|
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
# See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Web Digital Signature",
|
||||||
|
"version": "14.0.1.0.0",
|
||||||
|
"author": "Serpent Consulting Services Pvt. Ltd.",
|
||||||
|
"maintainer": "Serpent Consulting Services Pvt. Ltd.",
|
||||||
|
"complexity": "easy",
|
||||||
|
"depends": ["web"],
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"category": "Tools",
|
||||||
|
"description": """
|
||||||
|
This module provides the functionality to store digital signature
|
||||||
|
Example can be seen into the User's form view where we have
|
||||||
|
added a test field under signature.
|
||||||
|
""",
|
||||||
|
"summary": """
|
||||||
|
Touch screen enable so user can add signature with touch devices.
|
||||||
|
Digital signature can be very usefull for documents.
|
||||||
|
""",
|
||||||
|
"images": ["static/description/Digital_Signature.jpg"],
|
||||||
|
"data": ["views/web_digital_sign_view.xml", "views/users_view.xml"],
|
||||||
|
"website": "http://www.serpentcs.com",
|
||||||
|
"qweb": ["static/src/xml/digital_sign.xml"],
|
||||||
|
"installable": True,
|
||||||
|
"auto_install": False,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
# See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from . import users
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
# See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
|
class Users(models.Model):
|
||||||
|
_inherit = "res.users"
|
||||||
|
|
||||||
|
digital_signature = fields.Binary(string="Signature")
|
||||||
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 199 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 177 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
|
@ -0,0 +1,259 @@
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row">
|
||||||
|
<div class="text-justify" style="background:#dcdcdc;padding-top:2px;padding-bottom:2px">
|
||||||
|
<h2 class="oe_slogan" style="color:#875A7B;font-family:times new roman;margin-top:20px;margin-bottom:20px;">
|
||||||
|
<span class="label">
|
||||||
|
Web Digital Signature
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
<hr width="60%" style="border-style:solid;border-top-width:2px;" />
|
||||||
|
<h3 class="oe_slogan" style="font-family:times new roman;">This module provides the functionality to store digital signature for a record</h3>
|
||||||
|
<table class="text-justify" style="margin-left: 10px;margin-right: 10px;margin-bottom: 10px;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span class="fa fa-hand-o-right fa-2x" style="padding-bottom:25px;padding-right:10px;color:#875A7B;"/>
|
||||||
|
</td>
|
||||||
|
<td class="oe_mt8" style="font-size: 18px;font-family:times new roman;">
|
||||||
|
This module is helpful to make your business process a little bit more faster & makes it more user friendly by providing you digital signature functionality on your documents.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span class="fa fa-hand-o-right fa-2x" style="color:#875A7B;"/>
|
||||||
|
</td>
|
||||||
|
<td class="oe_mt8" style="font-size: 18px;font-family:times new roman;">
|
||||||
|
It is touch screen enable so user can add signature with touch devices.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span class="fa fa-hand-o-right fa-2x" style="padding-bottom:25px;;color:#875A7B;"/>
|
||||||
|
</td>
|
||||||
|
<td class="oe_mt8" style="font-size: 18px;font-family:times new roman;">
|
||||||
|
Digital signature can be very useful for documents such as sale orders, purchase orders, invoices, payslips, procurement receipts, etc.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<hr width="100%" style="border-style:solid;border-top-width:2px;" />
|
||||||
|
<h2 class="oe_slogan" style="margin-top:20px;margin-bottom:20px;color:#875A7B;font-family:times new roman;">
|
||||||
|
<span class="label">
|
||||||
|
Usage
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
<h3 class="oe_slogan" style="margin-top:10px;margin-bottom:10px;font-family:times new roman;">To use this module, you need to add widget="signature" to your binary field in your view.</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<hr width="100%" style="border-style:solid;border-top-width:2px;" />
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row" style="padding-top:2px;padding-bottom:2px;background:#dcdcdc">
|
||||||
|
<div>
|
||||||
|
<h2 class="oe_slogan" style="margin-top:20px;margin-bottom:20px;color:#875A7B;font-family:times new roman;">
|
||||||
|
<span class="label">
|
||||||
|
Signature Views
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
<hr width="60%" style="border-style:solid;border-top-width:2px;" />
|
||||||
|
<h4 class="oe_slogan" style="font-size:24px;font-family:times new roman;color:#875A7B;">
|
||||||
|
<span class="label">
|
||||||
|
<span class="fa fa-star fa-spin"/>
|
||||||
|
Digital Signature View
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
<p class='oe_mt32' style="text-align:center;font-size: 18px;font-family:times new roman;">User can store their digital signature
|
||||||
|
in the binary field, as you can see image.</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img class="oe_demo oe_picture oe_screenshot" src="img/sign1.png">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h4 class="oe_slogan" style="font-size:24px;font-family:times new roman;color:#875A7B;">
|
||||||
|
<span class="label">
|
||||||
|
<span class="fa fa-star fa-spin"/>
|
||||||
|
Draw Signature
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
<p class='oe_mt32' style="text-align:center;font-size: 18px;font-family:times new roman;">As shown in the image, user can add a signature using mouse, pen, or finger.</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img class="oe_demo oe_picture oe_screenshot" src="img/sign2.png">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h4 class="oe_slogan" style="font-size:24px;font-family:times new roman;color:#875A7B;">
|
||||||
|
<span class="label" >
|
||||||
|
<span class="fa fa-star fa-spin"/>
|
||||||
|
Clear Digital Signature
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
<p class='oe_mt32' style="text-align:center;font-size: 18px;font-family:times new roman;">User can clear signature using clear button and it will re-initialize the signature.</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img class="oe_demo oe_picture oe_screenshot" src="img/sign3.png">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- LEFT::LEFT PHOTO - MEDIUM -->
|
||||||
|
|
||||||
|
<table style="font-family: 'Helvetica Neue', Helvetica, Arial,
|
||||||
|
sans-serif;" cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="font-size:16px; color:#d74930; font-weight:bold;" width="100%" align="center">
|
||||||
|
<span class="fa fa-certificate fa-1x" style="color:#1f2327;">Check out our various Odoo Services below</span>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<table style="font-size:11px; color:#697582; line-height:20px;" cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/consulting" style="color:#697582; text-decoration:none;">Odoo Consulting</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/gap-analysis" style="color:#697582; text-decoration:none;">Gap Analysis and BPR</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/implementation" style="color:#697582; text-decoration:none;">Odoo Implementation</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/ecommerce-integrations/magento-integration" style="color:#697582; text-decoration:none;">Integration with E-Commerce</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/trainings/openerp-odoo-technical-training" style="color:#697582; text-decoration:none;">Odoo Technical Training</a></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/offshore-development-partnership" style="color:#697582; text-decoration:none;">Offshore & Onsite Development</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/odoo-packages/odoo-support-package" style="color:#697582; text-decoration:none;">Support and Maintenance</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/hire-odoo-openerp-developer" style="color:#697582; text-decoration:none;">Hire Dedicated Odoo Developer</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/ecommerce-integrations/paymentech-elavon-paypal-integration" style="color:#697582; text-decoration:none;">Payment Gateway Integrations</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/trainings/openerpodoo-functional-training" style="color:#697582; text-decoration:none;">Odoo Functional Training</a></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/community/aios-mobile-client" style="color:#697582; text-decoration:none;">Odoo Mobile App Development</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.odooqa.com/page/manual-functional-testing" style="color:#697582; text-decoration:none;">Odoo Manual Testing</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.odooqa.com/page/automated-functional-testing" style="color:#697582; text-decoration:none;">Odoo Automated Testing</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/ecommerce-integrations/fedex-ups-usps-integration" style="color:#697582; text-decoration:none;">Integration with Shipping API</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com/services/odoo-openerp-services/installation-and-hosting" style="color:#697582; text-decoration:none;">Installation & Hosting</a></span></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="font-size:16px; color:#d74930; font-weight:bold;" width="100%" align="center">
|
||||||
|
<span class="fa fa-certificate fa-1x" style="color:#1f2327;">Check out our various Odoo Based Products</span >
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<table style="font-size:11px; color:#697582; line-height:20px;" cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-coffee fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/restaurant-management-system" style="color:#697582; text-decoration:none;">Restaurant Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-building fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/property-management-system" style="color:#697582; text-decoration:none;">Property Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-plane fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/visa-management-system" style="color:#697582; text-decoration:none;">Visa Agency Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/odoo-singapore-localization" style="color:#697582; text-decoration:none;">Singapore Localization</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-graduation-cap fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/education-management-system" style="color:#697582; text-decoration:none;">School, University Management</a></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-cubes fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/construction-management-system" style="color:#697582; text-decoration:none;">Construction Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-bus fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/fleet-management-systems" style="color:#697582; text-decoration:none;">Fleet Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-stethoscope fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/healthcare-management-software" style="color:#697582; text-decoration:none;">Medical ERP</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-hotel fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/hotel-management-system" style="color:#697582; text-decoration:none;">Hotel Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-users fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/human-resource-management-system" style="color:#697582; text-decoration:none;">Human Resource Management</a></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="20%"><span class="fa fa-map-marker fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/odoo-fieldstaff-tracking-system" style="color:#697582; text-decoration:none;">Field Service Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/spa-salon-management-system" style="color:#697582; text-decoration:none;">Spa & Salone Management</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-phone fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/odoo-ringcentral-integration" style="color:#697582; text-decoration:none;">Ringcentral telephone integration</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-heart fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/customer-relationship-management" style="color:#697582; text-decoration:none;">Customer Relationship</a></span></td>
|
||||||
|
<td width="20%"><span class="fa fa-user fa-1x" style="color:#697582;"> <a href="http://serpentcs.in/product/talent-management-system" style="color:#697582; text-decoration:none;">Talent Management</a></span></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="font-size:16px; color:#d74930; font-weight:bold;" width="100%" align="center">
|
||||||
|
<span class="fa fa-certificate fa-1x" style="color:#1f2327;">For any questions, support and development contact us.</span>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<table style="font-size:11px; color:#697582; line-height:20px;" cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="38%"><span class="fa fa-whatsapp fa-1x" style="color:#697582;"> (+91) 98793-54457, (+91) 90334-72982 </span>
|
||||||
|
<span class="fa fa-phone fa-1x" style="color:#697582;"> +91-79-2975-0867</span></td>
|
||||||
|
<td width="17%"><span class="fa fa-envelope fa-1x" style="color:#697582;"> <a href="mailto:contact@serpentcs.com" style="color:#697582; text-decoration:none;">contact@serpentcs.com</a></span></td>
|
||||||
|
<td width="15%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.com" style="color:#697582; text-decoration:none;">www.serpentcs.com</a></span></td>
|
||||||
|
<td width="15%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.serpentcs.in" style="color:#697582; text-decoration:none;">www.serpentcs.in</a></span></td>
|
||||||
|
<td width="15%"><span class="fa fa-globe fa-1x" style="color:#697582;"> <a href="http://www.odooqa.com" style="color:#697582; text-decoration:none;">www.odooqa.com</a></span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="38%"><span class="fa fa-hand-pointer-o fa-1x" style="color:#697582;"> WhatsApp, Telegram or Call 24X7</span></td>
|
||||||
|
<td width="17%"><span class="fa fa-hand-pointer-o fa-1x" style="color:#697582;"> Help! Send Mail</span></td>
|
||||||
|
<td width="15%"><span class="fa fa-hand-pointer-o fa-1x" style="color:#697582;"> Browse our Services</span></td>
|
||||||
|
<td width="15%"><span class="fa fa-hand-pointer-o fa-1x" style="color:#697582;"> Browse our Products</span></td>
|
||||||
|
<td width="15%"><span class="fa fa-hand-pointer-o fa-1x" style="color:#697582;"> QA Services</span></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr colspan="2">
|
||||||
|
<td colspan="2" style="border-bottom:#d74930 solid 1px; line-height:10px;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr colspan="2">
|
||||||
|
<td colspan="2" style="padding-top:9px;">
|
||||||
|
<a href="https://www.facebook.com/Serpent-Consulting-Services-Pvt-Ltd-299017730141795/" style="text-decoration:none;"><img src="fb.jpg" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="https://twitter.com/Serpent_CS" style="text-decoration:none;"><img src="twitter.jpg" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.linkedin.com/company-beta/2435682/" style="text-decoration:none;"><img src="in.jpg" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.youtube.com/user/husendaudi123/videos" style="text-decoration:none;"><img src="youtube.jpg" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="https://www.instagram.com/explore/tags/serpentcs/"style="text-decoration:none;"><img src="insta.jpg" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="http://www.serpentcs.com"style="text-decoration:none;"><img src="serpent32.png" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="http://www.serpentcs.in"style="text-decoration:none;"><img src="serpent32.png" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
<a href="http://www.odooqa.com"style="text-decoration:none;"><img src="odooqa32.png" style="vertical-align:middle; border-radius: 50%;" width="25">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr colspan="2">
|
||||||
|
<td colspan="2" style="font-size:8px; color:#697582; line-height:15px;padding-top:10px; text-align:justify;">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -0,0 +1,160 @@
|
||||||
|
odoo.define('web_digital_sign.web_digital_sign', function (require) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var core = require('web.core');
|
||||||
|
var BasicFields= require('web.basic_fields');
|
||||||
|
var FormController = require('web.FormController');
|
||||||
|
var Registry = require('web.field_registry');
|
||||||
|
var utils = require('web.utils');
|
||||||
|
var session = require('web.session');
|
||||||
|
var field_utils = require('web.field_utils');
|
||||||
|
|
||||||
|
var _t = core._t;
|
||||||
|
var QWeb = core.qweb;
|
||||||
|
|
||||||
|
var FieldSignature = BasicFields.FieldBinaryImage.extend( {
|
||||||
|
template: 'FieldSignature',
|
||||||
|
events: _.extend({}, BasicFields.FieldBinaryImage.prototype.events, {
|
||||||
|
'click .save_sign': '_on_save_sign',
|
||||||
|
'click #sign_clean': '_on_clear_sign',
|
||||||
|
}),
|
||||||
|
jsLibs: ['/web_digital_sign/static/lib/jSignature/jSignatureCustom.js'],
|
||||||
|
placeholder: "/web/static/src/img/placeholder.png",
|
||||||
|
init: function (parent, name, record) {
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
this.sign_options = {
|
||||||
|
'decor-color': '#D1D0CE',
|
||||||
|
'color': '#000',
|
||||||
|
'background-color': '#fff',
|
||||||
|
'height': '150',
|
||||||
|
'width': '550',
|
||||||
|
};
|
||||||
|
this.empty_sign = [];
|
||||||
|
},
|
||||||
|
start: function () {
|
||||||
|
var self = this;
|
||||||
|
this.$(".signature").jSignature("init", this.sign_options);
|
||||||
|
this.$(".signature").attr( {
|
||||||
|
"tabindex": "0",
|
||||||
|
'height': "100",
|
||||||
|
});
|
||||||
|
this.empty_sign = this.$(".signature").jSignature("getData",
|
||||||
|
'image');
|
||||||
|
self._render();
|
||||||
|
},
|
||||||
|
_on_clear_sign: function () {
|
||||||
|
this.$(".signature > canvas").remove();
|
||||||
|
this.$('> img').remove();
|
||||||
|
this.$(".signature").attr("tabindex", "0");
|
||||||
|
var sign_options = {
|
||||||
|
'decor-color': '#D1D0CE',
|
||||||
|
'color': '#000',
|
||||||
|
'background-color': '#fff',
|
||||||
|
'height': '150',
|
||||||
|
'width': '550',
|
||||||
|
'clear': true,
|
||||||
|
};
|
||||||
|
this.$(".signature").jSignature(sign_options);
|
||||||
|
this.$(".signature").focus();
|
||||||
|
this._setValue(false);
|
||||||
|
},
|
||||||
|
_on_save_sign: function (value_) {
|
||||||
|
var self = this;
|
||||||
|
this.$('> img').remove();
|
||||||
|
var signature = this.$(".signature").jSignature("getData", 'image');
|
||||||
|
var is_empty = signature ?
|
||||||
|
self.empty_sign[1] === signature[1] :
|
||||||
|
false;
|
||||||
|
if (!is_empty && typeof signature !== "undefined" && signature[1]) {
|
||||||
|
this._setValue(signature[1]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_render: function () {
|
||||||
|
var self = this;
|
||||||
|
var url = this.placeholder;
|
||||||
|
if (this.value && !utils.is_bin_size(this.value)) {
|
||||||
|
url = 'data:image/png;base64,' + this.value;
|
||||||
|
} else if (this.value) {
|
||||||
|
url = session.url('/web/image', {
|
||||||
|
model: this.model,
|
||||||
|
id: JSON.stringify(this.res_id),
|
||||||
|
field: this.nodeOptions.preview_image || this.name,
|
||||||
|
unique:
|
||||||
|
field_utils.format.datetime(
|
||||||
|
this.recordData.__last_update).replace(/[^0-9]/g, ''),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
url = this.placeholder;
|
||||||
|
}
|
||||||
|
if (this.mode === "readonly") {
|
||||||
|
var $img = $(QWeb.render("FieldBinaryImage-img", {
|
||||||
|
widget: self,
|
||||||
|
url: url,
|
||||||
|
}));
|
||||||
|
this.$('> img').remove();
|
||||||
|
this.$(".signature").hide();
|
||||||
|
this.$el.prepend($img);
|
||||||
|
$img.on('error', function () {
|
||||||
|
self.on_clear();
|
||||||
|
$img.attr('src', self.placeholder);
|
||||||
|
self.do_warn(_t("Image"),
|
||||||
|
_t("Could not display the selected image."));
|
||||||
|
});
|
||||||
|
} else if (this.mode === "edit") {
|
||||||
|
this.$('> img').remove();
|
||||||
|
if (this.value) {
|
||||||
|
var field_name = this.nodeOptions.preview_image ?
|
||||||
|
this.nodeOptions.preview_image :
|
||||||
|
this.name;
|
||||||
|
self._rpc( {
|
||||||
|
model: this.model,
|
||||||
|
method: 'read',
|
||||||
|
args: [this.res_id, [field_name]],
|
||||||
|
}).then(function (data) {
|
||||||
|
if (data) {
|
||||||
|
var field_desc = _.values(_.pick(data[0],
|
||||||
|
field_name));
|
||||||
|
self.$(".signature").jSignature("clear");
|
||||||
|
self.$(".signature").jSignature("setData",
|
||||||
|
'data:image/png;base64,' + field_desc[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$('> img').remove();
|
||||||
|
this.$('.signature > canvas').remove();
|
||||||
|
var sign_options = {
|
||||||
|
'decor-color': '#D1D0CE',
|
||||||
|
'color': '#000',
|
||||||
|
'background-color': '#fff',
|
||||||
|
'height': '150',
|
||||||
|
'width': '550',
|
||||||
|
};
|
||||||
|
this.$(".signature").jSignature("init", sign_options);
|
||||||
|
}
|
||||||
|
} else if (this.mode === 'create') {
|
||||||
|
this.$('> img').remove();
|
||||||
|
this.$('> canvas').remove();
|
||||||
|
if (!this.value) {
|
||||||
|
this.$(".signature").empty().jSignature("init", {
|
||||||
|
'decor-color': '#D1D0CE',
|
||||||
|
'color': '#000',
|
||||||
|
'background-color': '#fff',
|
||||||
|
'height': '150',
|
||||||
|
'width': '550',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
FormController.include( {
|
||||||
|
saveRecord: function () {
|
||||||
|
this.$('.save_sign').click();
|
||||||
|
return this._super.apply(this, arguments);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
Registry.add('signature', FieldSignature);
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<templates id="template" xml:space="preserve">
|
||||||
|
<t t-name="FieldSignature">
|
||||||
|
<t t-if="widget.mode != 'readonly'">
|
||||||
|
<div class="note-editor panel panel-default mt16 mb0 oe_edit_only" id="drawsign">
|
||||||
|
<div class="note-toolbar panel-heading p-2">
|
||||||
|
<div class="pull-right">
|
||||||
|
<a id="sign_clean" class="btn btn-xs oe_edit_only">Clear</a>
|
||||||
|
<a class="oe_edit_only save_sign"></a>
|
||||||
|
</div>
|
||||||
|
<strong>Draw your signature</strong>
|
||||||
|
</div>
|
||||||
|
<div class="signature"></div>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
<t t-if="widget.mode == 'readonly'">
|
||||||
|
<div class="panel panel-default mt16 mb0 " id="drawsign">
|
||||||
|
<div class="signature"></div>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
</t>
|
||||||
|
</templates>
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="inherited_res_users_form" model="ir.ui.view">
|
||||||
|
<field name="name">inherited.res.users.form</field>
|
||||||
|
<field name="model">res.users</field>
|
||||||
|
<field name="inherit_id" ref="base.view_users_form" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='signature']" position="after">
|
||||||
|
<label for="digital_signature" string="Signature" class="oe_edit_only" />
|
||||||
|
<h2>
|
||||||
|
<field name="digital_signature" widget="signature"/>
|
||||||
|
</h2>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<record id="inherited_res_users_preferences_form" model="ir.ui.view">
|
||||||
|
<field name="name">inherited.res.users.preferences.form</field>
|
||||||
|
<field name="model">res.users</field>
|
||||||
|
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='signature']" position="after">
|
||||||
|
<label for="digital_signature" string="Signature" class="oe_edit_only"/>
|
||||||
|
<h2>
|
||||||
|
<field name="digital_signature" widget="signature"/>
|
||||||
|
</h2>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<template id="web_digital_sign_backend" name="web_digital_sign assets" inherit_id="web.assets_backend">
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<script type="text/javascript" src="/web_digital_sign/static/src/js/digital_sign.js"/>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</odoo>
|
||||||