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.

25 lines
820 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(string='Digital Signature',
  10. oldname="signature_image")
  11. @api.model
  12. def create(self, vals):
  13. res = super(ResUsers, self).create(vals)
  14. res._track_signature(vals, 'digital_signature')
  15. return res
  16. @api.multi
  17. def write(self, vals):
  18. self._track_signature(vals, 'digital_signature')
  19. return super(ResUsers, self).write(vals)