Accept Merge Request #484: (feature/制造-计划优化 -> develop)
Merge Request: 解决sequence bug,增加“丢弃”二次确认模态框 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/484
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums.xml',
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums2.xml',
|
||||
'jikimo_frontend/static/src/views/list_nums/list_nums3.xml',
|
||||
'jikimo_frontend/static/src/js/custom_form_status_indicator.js',
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import {patch} from '@web/core/utils/patch';
|
||||
// import { Dialog } from "@web/core/dialog/dialog";
|
||||
import {_t} from "@web/core/l10n/translation";
|
||||
import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator"
|
||||
|
||||
var Dialog = require('web.Dialog');
|
||||
// var {patch} = require("web.utils") 这句话也行
|
||||
|
||||
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
|
||||
// 你可以重写或者添加一些方法和属性
|
||||
async _onDiscardChanges() {
|
||||
var self = this;
|
||||
Dialog.confirm(this, _t("Are you sure you want to discard changes?"), {
|
||||
title: _t("Discard Changes"),
|
||||
|
||||
// confirm_callback: function () {
|
||||
// self.model.discardChanges(self.handle);
|
||||
// },
|
||||
});
|
||||
},
|
||||
|
||||
async discard() {
|
||||
// if (window.confirm("Are you sure you want to discard changes?")) {
|
||||
// await this.props.discard();
|
||||
// }
|
||||
const result = await this._confirmDiscardChange();
|
||||
await this.props.discard();
|
||||
},
|
||||
|
||||
_confirmDiscardChange(){
|
||||
var self = this;
|
||||
var def = new Promise(function (resolve, reject) {
|
||||
var message = _t("请确认是否要舍弃之前的更改?");
|
||||
var dialog = Dialog.confirm(self, message, {
|
||||
title: _t("Warning"),
|
||||
confirm_callback: resolve.bind(self, true),
|
||||
cancel_callback: reject,
|
||||
});
|
||||
dialog.on('closed', self, reject);
|
||||
});
|
||||
return def;
|
||||
},
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp_workorder', 'sale'],
|
||||
'depends': ['account', 'base', 'mrp_workorder', 'sale', 'purchase'],
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
|
||||
@@ -84,6 +84,29 @@
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- 移除字段属性 -->
|
||||
<record id="view_order_form_inherited" model="ir.ui.view">
|
||||
<field name="name">sale.order.form.inherited</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||
<attribute name="widget"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_purchase_form_inherited" model="ir.ui.view">
|
||||
<field name="name">purchase.order.form.inherited</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||
<attribute name="widget"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- <record id="mrp_workorder.menu_mrp_workorder_workcenter" model="ir.ui.menu"> -->
|
||||
|
||||
Reference in New Issue
Block a user