You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
797 B

  1. # Copyright 2004-2010 OpenERP SA (<http://www.openerp.com>)
  2. # Copyright 2011-2015 Serpent Consulting Services Pvt. Ltd.
  3. # Copyright 2017 Tecnativa - Vicent Cubells
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from odoo import api, fields, models
  6. class ResUsers(models.Model):
  7. _name = 'res.users'
  8. _inherit = ['res.users', 'mail.thread']
  9. digital_signature = fields.Binary(
  10. string='Signature',
  11. oldname="signature_image",
  12. )
  13. @api.model
  14. def create(self, vals):
  15. res = super(ResUsers, self).create(vals)
  16. res._track_signature(vals, 'digital_signature')
  17. return res
  18. @api.multi
  19. def write(self, vals):
  20. self._track_signature(vals, 'digital_signature')
  21. return super(ResUsers, self).write(vals)