diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js index 912c8efa..46e3ad70 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -53,6 +53,23 @@ const tableRequiredList = [ ] patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', { + setup() { + owl.onMounted(() => { + try { + const dom = this.__owl__.bdom.el + const buttonsDom = $(dom).find('.o_form_status_indicator_buttons ') + if (buttonsDom) { + const dom1 = buttonsDom.children('.o_form_button_save') + const dom2 = buttonsDom.children('.o_form_button_cancel') + dom1.append('保存') + dom2.append('取消') + } + } catch (e) { + console.log(e) + } + + }); + }, // 你可以重写或者添加一些方法和属性 async _onDiscardChanges() { // var self = this; @@ -183,17 +200,6 @@ patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', { // }) $(function () { - document.addEventListener('click', function () { - const dom = $('.o_form_status_indicator_buttons ') - if (dom) { - const dom1 = dom.children().eq(0) - const dom2 = dom.children().eq(1) - if (!dom1.text()) { - dom1.append('保存') - dom2.append('取消') - } - } - }) function customRequired() { let timer = null