[FIX] portal: sent form without signing

In the portal, when the client signature is asked (for a SO for example).

Before this commit, the client could send the form without really signing
the document.

Now, a warning is shown if the form is not signed.

opw-1943702

closes odoo/odoo#31768

Signed-off-by: Sébastien Theys <seb-odoo@users.noreply.github.com>


Co-authored-by: Sébastien Theys <seb@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2019-03-12 14:58:17 +00:00
co-authored by Sébastien Theys
parent 37689b189e
commit 47016a1df3
@@ -116,14 +116,21 @@ odoo.define('portal.signature_form', function (require){
base.ready().then(function () {
$('.o_portal_signature_form').each(function () {
var hasBeenReset = false;
var $elem = $(this);
var form = new SignatureForm(null, $elem.data());
form.appendTo($elem);
});
// Make the signature responsive when it is displayed in bootstrap modal.
// More precisely it is too small if this code is not here.
$('.o_portal_signature_form').parents('.modal').on('shown.bs.modal', function (ev) {
$('.o_portal_signature_form').trigger('resize');
// Make the signature responsive when it is displayed in bootstrap modal.
// More precisely it is too small if this code is not here.
$elem.parents('.modal').on('shown.bs.modal', function (ev) {
$elem.trigger('resize');
if (!hasBeenReset) {
// Reset it only the first time it is open to get correct
// size. After we want to keep its content on reopen.
hasBeenReset = true;
form.initSign();
}
});
});
});