Search code examples
javascriptodoo-11qwebodoo-enterprise

Odoo11 EE How removing signature advertisement


I'm trying to inherit website_sign.thank_you_dialog but this has no id. I would like to delete the advertisement that appears in the pop up when completing the signatures.

Odoo 11 EE

/static/src/js/remove_ad_signature.js

odoo.define('my_module.signature_request_template', function(require) { 
    'use strict'

    var ajax = require("web.ajax");
    var core = require("web.core");
    var qweb = core.qweb;
    var document_signing = require("website_sign.document_signing");

    ajax.loadXML("/my_module/static/src/xml/remove_ad_signature.xml", qweb).then(function () {
    document_signing.initDocumentToSign();
    });
})


/static/src/xml/remove_ad_signature.xml

<?xml version="1.0" encoding="UTF-8"?>
 <templates id="remove_ad_signature" xml:space="preserve">
     <t t-extend="website_sign.thank_you_dialog">
         <t t-jquery="div.o_promote_esign" t-operation="replace">
             <div class="o_promote_esign">
                 <div>AAAAAAAAAAAAA</div>                 
             </div>                                       
         </t>                                             
     </t>                                                 

 </templates>

I see AAAAAA on the modal but return this error Sorry, an error occured, please try to fill the document again. enter image description here


Solution

  • Solved by myself add in static/src/js/remove_signature_ad.js

    odoo.define("agreements_esign.remove_signature_ad_button", function (require) {
      "use strict"
    
      var core = require("web.core")
      var document_signing = require("website_sign.document_signing")
      var _t = core._t
    
      var NoPubThankYouDialog = document_signing.ThankYouDialog.extend({
        template: "website_sign.no_pub_thank_you_dialog",
    
        init: function (parent, options) {
          options = options || {}
          if (!options.buttons) {
            options.buttons = [{ text: _t("Close"), close: true }]
          }
    
          this._super(parent, options)
        }
        })
    
      document_signing.SignableDocument.include({
        get_thankyoudialog_class: function () {
          return NoPubThankYouDialog
        },
      })
    })
    

    Now I see this

    enter image description here