From a57cdbe2f3cab8cf150003f08c530e3eeeb03a28 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Tue, 17 Oct 2023 15:10:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=85=B6=E4=BB=96table?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/models/sf_maintenance.py | 8 ++++++++ sf_maintenance/views/maintenance_views.xml | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index ec704d6a..5c916387 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -316,6 +316,14 @@ class SfMaintenanceEquipment(models.Model): robot_operating_temperature = fields.Char('环境温度') robot_operating_humidity = fields.Char('环境湿度') + # 其他参数(所有设备) + date_of_purchase = fields.Date('采购日期') + date_of_manufacture = fields.Date('出厂日期') + date_of_warranty = fields.Date('质保截至日期') + original_value = fields.Char('原值') + incomplete_value = fields.Char('残值') + + diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index 971deccf..8156c886 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -972,6 +972,11 @@ + + + + + From 587e2a4e3e3e8a71fc726c94c13cadef086ed1d1 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Fri, 20 Oct 2023 10:50:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsequence=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=AD=97=E6=AE=B5=E5=80=BC=E7=A7=BB=E5=8A=A8=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/__manifest__.py | 2 +- .../views/operations_rename_menu.xml | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index bcb25c81..6febb711 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -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', diff --git a/sf_plan_management/views/operations_rename_menu.xml b/sf_plan_management/views/operations_rename_menu.xml index 28bc5c6c..659df6dd 100644 --- a/sf_plan_management/views/operations_rename_menu.xml +++ b/sf_plan_management/views/operations_rename_menu.xml @@ -84,6 +84,29 @@ + + + sale.order.form.inherited + sale.order + + + + + + + + + + purchase.order.form.inherited + purchase.order + + + + + + + + From 749473f9dc52e26963152748272a0bb8d4362e63 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 23 Oct 2023 00:17:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?form=E8=A7=86=E5=9B=BE=E7=9A=84=E4=B8=A2?= =?UTF-8?q?=E5=BC=83=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_frontend/__manifest__.py | 1 + .../src/js/custom_form_status_indicator.js | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 jikimo_frontend/static/src/js/custom_form_status_indicator.js diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py index f2096eea..4165a503 100644 --- a/jikimo_frontend/__manifest__.py +++ b/jikimo_frontend/__manifest__.py @@ -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', ], }, diff --git a/jikimo_frontend/static/src/js/custom_form_status_indicator.js b/jikimo_frontend/static/src/js/custom_form_status_indicator.js new file mode 100644 index 00000000..fd06fe75 --- /dev/null +++ b/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; + }, + +} +); + +