[FIX] sale: change type of signature from Binary to Image

- ensure a valid image was given or prevent to save it otherwise, instead of
  allowing any file, which would then crash at display
- restrict to a reasonable size

PR: #38292
closes #38026

closes odoo/odoo#39098

X-original-commit: 92eafdf7e283e5474b1da2c88cfbdebbee17b48e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2019-10-21 09:08:11 +00:00
committed by fw-bot
parent 20ac5338ac
commit 08d0a90a51
+1 -1
View File
@@ -208,7 +208,7 @@ class SaleOrder(models.Model):
change_default=True, default=_get_default_team, check_company=True, # Unrequired company
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
signature = fields.Binary('Signature', help='Signature received through the portal.', copy=False, attachment=True)
signature = fields.Image('Signature', help='Signature received through the portal.', copy=False, attachment=True, max_width=1024, max_height=1024)
signed_by = fields.Char('Signed By', help='Name of the person that signed the SO.', copy=False)
signed_on = fields.Datetime('Signed On', help='Date of the signature.', copy=False)