Browse Source

Digital sign module updated with example

pull/267/head
Serpent Consulting Services Pvt. Ltd 10 years ago
committed by eLBati
parent
commit
139f6d6561
  1. 1
      web_digital_sign/__init__.py
  2. 3
      web_digital_sign/__openerp__.py
  3. 32
      web_digital_sign/users.py
  4. 18
      web_digital_sign/users_view.xml

1
web_digital_sign/__init__.py

@ -20,4 +20,5 @@
# #
############################################################################## ##############################################################################
import users
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

3
web_digital_sign/__openerp__.py

@ -29,8 +29,9 @@
'depends': ['web'], 'depends': ['web'],
"description": """ "description": """
This module provides the functionality to store digital signature image for a record. This module provides the functionality to store digital signature image for a record.
The example can be seen into the User's form view where we have added a test field under signature.
""", """,
'data': [],
'data': ['users_view.xml'],
'js':[ 'js':[
"static/lib/excanvas.js", "static/lib/excanvas.js",
"static/lib/jquery.signature.js", "static/lib/jquery.signature.js",

32
web_digital_sign/users.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2011-2015 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/>.
#
##############################################################################
from openerp.osv import osv, fields
class Users(osv.Model):
_inherit = 'res.users'
_columns = {
'signature_image': fields.binary('Signature')
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

18
web_digital_sign/users_view.xml

@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<openerp>
<data>
<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="replace">
<label for="signature_image" class="oe_edit_only"/>
<h2><field name="signature_image" widget="signature"/></h2>
</xpath>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save