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 7db13b4b..100542b8 100644
--- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js
+++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js
@@ -4,6 +4,7 @@ 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";
+import {ListRenderer} from "@web/views/list/list_renderer";
import {Field} from "@web/views/fields/field";
@@ -45,6 +46,11 @@ const filedRequiredList = {
'date_planned_start': { multiple: false, noLabel: false },
'date_planned_finished': { multiple: false, noLabel: false },
}
+const tableRequiredList = [
+ 'product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty',
+ 'name', 'fault_type', 'maintenance_standards', 'Period'
+]
+
patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', {
// 你可以重写或者添加一些方法和属性
async _onDiscardChanges() {
@@ -110,7 +116,24 @@ patch(Field.prototype, 'jikimo_frontend.Field', {
}
}
})
-
+patch(ListRenderer.prototype, 'jikimo_frontend.ListRenderer', {
+ setup(){
+ owl.onMounted(() => {
+ this.activeElement = this.uiService.activeElement;
+ this.setRequired()
+ })
+ return this._super(...arguments);
+ },
+ setRequired() {
+ this.allColumns.forEach(_ => {
+ if( tableRequiredList.indexOf(_.name) >= 0 ) {
+ const dom = $(`th[data-name=${_.name}]`)
+ let t = dom.html()
+ dom.html('*' + t)
+ }
+ })
+ }
+})
$(function () {
document.addEventListener('click', function () {
@@ -160,45 +183,13 @@ $(function () {
}, 500)
}
- function setRequired(dom = {label: [], table: []}) {
- let domTimer = null
- let timer_count = 0
- clearInterval(domTimer)
- domTimer = setInterval(() => {
- timer_count++
- const lint = $('.o_form_view_container')
- if (lint.length) {
- clearInterval(domTimer)
- const { table} = dom
-
- if (table.length) {
- table.forEach(_ => {
- const th = $(`th[data-name=${_}]`)
- const t = th.find('span').eq(0).text().replace('*','')
- th.find('span').eq(0).html('*' + t)
-
- })
-
- }
- }
- if (timer_count == 20) {
- clearInterval(domTimer)
- }
- }, 500)
- }
-
var currentUrl = location.href
- const customRequiredDom = {
- table: ['product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty', 'name', 'fault_type', 'maintenance_standards', 'Period']
- }
const listenerUrl = setInterval(() => {
const isChange = currentUrl != location.href
if (isChange) {
currentUrl = location.href
customRequired()
- setRequired(customRequiredDom)
}
}, 500)
customRequired()
- setRequired(customRequiredDom)
})
diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss
index bc1be730..f7195534 100644
--- a/jikimo_frontend/static/src/scss/custom_style.scss
+++ b/jikimo_frontend/static/src/scss/custom_style.scss
@@ -467,3 +467,15 @@ div:has(.o_required_modifier) > label::before {
background: #71639e;
color: #fff
}
+
+// 修改时间输入框宽度
+.o_datepicker_input.o_input.datetimepicker-input {
+ width: 200px;
+}
+
+
+.o_form_view .o_form_editable .o_row > .o_field_widget, .o_form_view .o_form_editable .o_row > .o_field_widget.o_field_float_time {
+ width: auto !important;
+ flex: unset;
+}
+
diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss
index fdc5821e..c91a8a77 100644
--- a/sf_base/static/src/scss/test.scss
+++ b/sf_base/static/src/scss/test.scss
@@ -189,3 +189,6 @@ td.o_required_modifier {
flex-direction: row !important;
}
+.supplier_ids_set_css thead th[data-name=partner_id]{
+ width: 500px!important;
+}
\ No newline at end of file
diff --git a/sf_base/views/common_view.xml b/sf_base/views/common_view.xml
index 0826b51c..e829274a 100644
--- a/sf_base/views/common_view.xml
+++ b/sf_base/views/common_view.xml
@@ -269,7 +269,7 @@
-
+