0

我正在尝试继承 website_sign.thank_you_dialog 但这没有 id。我想删除完成签名时弹出的广告。

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>

我在模态框上看到 AAAAAA 但返回此错误抱歉,出现错误,请尝试重新填写文档。 在此处输入图像描述

4

1 回答 1

0

自己解决添加在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
    },
  })
})

现在我看到了这个

在此处输入图像描述

于 2020-06-17T07:16:11.647 回答