summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2019-03-12 08:54:46 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2019-03-12 14:58:17 +0000
commit47016a1df354fe4620a5f7e7bd8a3fc38d2e40df (patch)
treeab24ea95d09d420b1f12f8fc9269e71091e246fb
parent37689b189ee904497eb0ce0097ecf013cac1a91c (diff)
[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>
-rw-r--r--addons/portal/static/src/js/portal_signature.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/addons/portal/static/src/js/portal_signature.js b/addons/portal/static/src/js/portal_signature.js
index 3c19b3b8f91..35c06d0c531 100644
--- a/addons/portal/static/src/js/portal_signature.js
+++ b/addons/portal/static/src/js/portal_signature.js
@@ -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();
+ }
+ });
});
});