简体   繁体   English

Odoo11 EE 如何去除签名广告

[英]Odoo11 EE How removing signature advertisement

I'm trying to inherit website_sign.thank_you_dialog but this has no id.我正在尝试继承 website_sign.thank_you_dialog 但这没有 id。 I would like to delete the advertisement that appears in the pop up when completing the signatures.我想删除完成签名时弹出的广告。

Odoo 11 EE Odoo 11 EE

/static/src/js/remove_ad_signature.js /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 /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.我在模态框上看到 AAAAAA 但返回此错误抱歉,出现错误,请尝试重新填写文档。 在此处输入图像描述

Solved by myself add in static/src/js/remove_signature_ad.js自己解决添加在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现在我看到了这个

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM