Skip to content
Browse files

[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

closes #38026
  • Loading branch information...
seb-odoo committed Oct 9, 2019
1 parent 59920da commit b622439593785bdae05f28ade674b9ea1b029ac4
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/sale/models/
@@ -208,7 +208,7 @@ def _get_payment_type(self):
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)

0 comments on commit b622439

Please sign in to comment.
You can’t perform that action at this time.