Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
2885 Переглядів

Hello!

Is it somehow possible in the quotes customer-view (in the customer-portal) to disable the option "auto" in the signature module?

In my opinion, the process should start directly with the option "draft". I don't think that a signature with auto mode is legally binding.

I don't think it's user friendly if the customer has to click on "draft" first to place his real signature.

I really would love to use the signature module if it is possible to disable this auto-option.

Thanks for your support
Daniel


PS: I would have posted a screenshot but am not yet allowed to post images.


Аватар
Відмінити

Any update?

We think the same, this is not legal in spain.

Did you find a solution?

Автор

@Sergio: Sorry, I didn't find any solution until now.

Найкраща відповідь

You can Simply use this xml snippet for this to disable auto option

<?xml version="1.0" encoding="UTF-8"?>

<templates xml:space="preserve">

    <!-- Inherit the existing template for NameAndSignature -->

    <t t-inherit="web.NameAndSignature" t-inherit-mode="extension">

        <xpath expr="//div[@t-if='state.showSignatureArea']" position="attributes">

            <attribute name="t-if">true</attribute>

        </xpath>

        <xpath expr="//canvas[@t-if='state.showSignatureArea']" position="attributes">

            <attribute name="t-if">true</attribute>

        </xpath>

        <!-- If wanted to hide Auto button -->

        <xpath expr="//a[@t-on-click.prevent='onClickSignAuto']" position="replace"/>

    </t>

</templates>



and add this xml file web.assets_frontend.

Аватар
Відмінити
Найкраща відповідь

I've found a better solution which works generally and not just for the portal:


odoo.define('your_module.name_and_signature_extension', function (require) {
"use strict";

var NameAndSignature = require('web.name_and_signature').NameAndSignature;

NameAndSignature.include({
init: function (parent, options) {
// Ensure options is an object to avoid errors
options = options || {};
// Set default mode to 'draw' if not provided
options.mode = options.mode || 'draw';
// Call the original init function with the modified options
this._super(parent, options);
},
});

});

put this snippet in a seperate modul at static/src/js 

and load file in web.assets_frontend section in manifest

"assets": {
​"web.assets_frontend": [
​"/your_module/static/src/js/name_and_signature.js",
​],
}


with this code the default_mode is set to 'draw'


Аватар
Відмінити
Найкраща відповідь

I found a solution:

Edit this file

portal/static/src/js/portal_signature.js

change in line 161:

'mode': this.$el.data('mode'),

by

'mode': 'draw',

and add this later to the same file:

var style = jQuery('');
jQuery('html > head').append(style);
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
серп. 25
1822
0
лип. 25
809
1
жовт. 24
1949
1
серп. 23
7564
0
черв. 23
2227