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
780 B

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