From 08d0a90a51396e4ef2bd023588bb15ee8ec0188f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 15 Oct 2019 14:12:15 +0000 Subject: [PATCH] [FIX] sale: change type of signature from Binary to Image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 6b61f3b32da..002762fb84f 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -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)