diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py index 65a11379..c3598323 100644 --- a/jikimo_frontend/__manifest__.py +++ b/jikimo_frontend/__manifest__.py @@ -10,9 +10,9 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['web', 'purchase'], + 'depends': ['web', 'purchase', 'base_setup'], 'data': [ - + 'views/bye_odoo.xml', ], 'demo': [ ], @@ -23,6 +23,8 @@ 'web.assets_backend': [ 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*', 'jikimo_frontend/static/src/fields/Many2OneRadioField/*', + # 移除odoo相关标识 + 'jikimo_frontend/static/src/bye_odoo/*', 'jikimo_frontend/static/src/scss/custom_style.scss', # 'jikimo_frontend/static/src/views/list_nums/list_nbCols.js', 'jikimo_frontend/static/src/views/list_nums/list_nums.xml', diff --git a/jikimo_frontend/data/demo_data.xml b/jikimo_frontend/data/demo_data.xml new file mode 100644 index 00000000..3c388606 --- /dev/null +++ b/jikimo_frontend/data/demo_data.xml @@ -0,0 +1,23 @@ + + + + + JKM + B-25 + USA + + + 1229 + +8801-712901764 + info@kolpolok.com + www.kolpoloktechnologies.com + + + + Custom + + + + + + diff --git a/jikimo_frontend/static/src/bye_odoo/extended_user_menu.js b/jikimo_frontend/static/src/bye_odoo/extended_user_menu.js new file mode 100644 index 00000000..bac689f1 --- /dev/null +++ b/jikimo_frontend/static/src/bye_odoo/extended_user_menu.js @@ -0,0 +1,16 @@ +/** @odoo-module **/ +import { UserMenu } from "@web/webclient/user_menu/user_menu"; +import { patch } from "@web/core/utils/patch"; +import { registry } from "@web/core/registry"; +const userMenuRegistry = registry.category("user_menuitems"); + + +patch(UserMenu.prototype, "legion_hide_odoo.UserMenu", { + setup() { + this._super.apply(this, arguments); + userMenuRegistry.remove("documentation"); + userMenuRegistry.remove("support"); + userMenuRegistry.remove("odoo_account"); + }, + +}); diff --git a/jikimo_frontend/static/src/bye_odoo/favicon.js b/jikimo_frontend/static/src/bye_odoo/favicon.js new file mode 100644 index 00000000..9ef4f4da --- /dev/null +++ b/jikimo_frontend/static/src/bye_odoo/favicon.js @@ -0,0 +1,11 @@ +/** @odoo-module **/ + +import { WebClient } from "@web/webclient/webclient"; +import { patch } from "web.utils"; + +patch(WebClient.prototype, "kolpolok_custom_title_and_favicon.WebClient", { + setup() { + this._super(); + this.title.setParts({ zopenerp: "JIKIMO" }); + }, +}); \ No newline at end of file diff --git a/jikimo_frontend/static/src/img/favicon.ico b/jikimo_frontend/static/src/img/favicon.ico new file mode 100644 index 00000000..95c0fba1 Binary files /dev/null and b/jikimo_frontend/static/src/img/favicon.ico differ diff --git a/jikimo_frontend/static/src/img/jikimo-logo.ico b/jikimo_frontend/static/src/img/jikimo-logo.ico new file mode 100644 index 00000000..b5bf7cd7 Binary files /dev/null and b/jikimo_frontend/static/src/img/jikimo-logo.ico differ diff --git a/jikimo_frontend/static/src/img/jikimo.ico b/jikimo_frontend/static/src/img/jikimo.ico new file mode 100644 index 00000000..69e69db9 Binary files /dev/null and b/jikimo_frontend/static/src/img/jikimo.ico differ 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 9825eeec..2bed0804 100644 --- a/jikimo_frontend/static/src/js/custom_form_status_indicator.js +++ b/jikimo_frontend/static/src/js/custom_form_status_indicator.js @@ -5,9 +5,44 @@ import {patch} from '@web/core/utils/patch'; import {_t} from "@web/core/l10n/translation"; import {FormStatusIndicator} from "@web/views/form/form_status_indicator/form_status_indicator"; +import {Field} from "@web/views/fields/field"; + var Dialog = require('web.Dialog'); // var {patch} = require("web.utils") 这句话也行 +const filedRequiredList = { + // 设备大模块 + 'control_system_id': { multiple: false, noLabel: false }, + 'workbench_L': { multiple: true, noLabel: false }, + 'number_of_axles': { multiple: true, noLabel: false }, + 'x_axis': { multiple: true, noLabel: false }, + 'number_of_knife_library': { multiple: false, noLabel: false }, + 'brand_id': { multiple: false, noLabel: false }, + 'type_id': { multiple: false, noLabel: false }, + 'taper_type_id': { multiple: false, noLabel: false }, + 'eq_maintenance_id': { multiple: false, noLabel: false }, + 'overhaul_id': { multiple: false, noLabel: false }, + 'overhaul_period': { multiple: false, noLabel: false }, + 'maintenance_equipment_category_id': { multiple: false, noLabel: false }, + 'maintenance_type': { multiple: false, noLabel: false }, + // 销售大模块 + 'partner_id': { multiple: false, noLabel: false }, + 'validity_date': { multiple: false, noLabel: false }, + 'vat': { multiple: false, noLabel: false }, + 'phone': { multiple: false, noLabel: false }, + 'mobile': { multiple: false, noLabel: false }, + 'email': { multiple: false, noLabel: false }, + 'category_id': { multiple: false, noLabel: false }, + 'radio_field_1_person': { multiple: false, noLabel: true }, + + // 采购大模块 + 'date_order': { multiple: false, noLabel: false }, + 'picking_type_id': { multiple: false, noLabel: false }, + + // 制造大模块 + 'production_line_id': { multiple: false, noLabel: false }, + 'date_approve': { multiple: false, noLabel: false }, +} patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', { // 你可以重写或者添加一些方法和属性 async _onDiscardChanges() { @@ -46,6 +81,38 @@ patch(FormStatusIndicator.prototype, 'jikimo_frontend.FormStatusIndicator', { } ); +patch(Field.prototype, 'jikimo_frontend.Field', { + setup() { + this.FieldComponent = this.props.fieldInfo.FieldComponent; + if (!this.FieldComponent) { + const fieldType = this.props.record.fields[this.props.name].type; + this.FieldComponent = getFieldClassFromRegistry(fieldType, this.props.type); + } + owl.onMounted(this.setRequired); + }, + setRequired() { + const id = this.props.id + const isRequired = filedRequiredList[id] + if(id == 'number_of_axles') { + console.log(isRequired) + } + if(isRequired) { + let dom; + dom = $(`label[for=${id}]`) + if(isRequired.multiple && dom.length > 1) { + dom = dom.eq(-1) + dom = dom.parent().parent().next().find('label') + } + if(isRequired.noLabel) { + dom = dom.parent().parent() + } + let t = dom.html() + t = '*' + t + dom.html(t) + } + } +}) + $(function () { document.addEventListener('click', function () { @@ -82,7 +149,7 @@ $(function () { dom.each(function () { const requiredDom = $(this).parent().prev().find('label') let t = requiredDom.html() - if (t.indexOf('c*') < 0) { + if (t && t.indexOf('c*') < 0) { t = '*' + t } requiredDom.html(t) @@ -104,16 +171,7 @@ $(function () { const lint = $('.o_form_view_container') if (lint.length) { clearInterval(domTimer) - const {label, table} = dom - if (label.length) { - $(dom.label.join(',')).each(function () { - let t = $(this).html() - if (t.indexOf('c*') < 0) { - t = '*' + t - } - $(this).html(t) - }) - } + const { table} = dom if (table.length) { table.forEach(_ => { @@ -133,8 +191,7 @@ $(function () { var currentUrl = location.href const customRequiredDom = { - label: ['label[for=production_line_id]','label[for=date_approve]','label[for=partner_id]', 'label[for=validity_date]', '.o_horizontal[role=radiogroup][aria-label="公司类别"]', 'label[for=vat]', 'label[for=phone]', 'label[for=mobile]', 'label[for=email]', 'label[for=category_id]','label[for=date_order]','label[for=picking_type_id]'], - table: ['product_template_id', 'product_uom_qty', 'price_unit','product_id','product_qty'] + 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 @@ -143,9 +200,6 @@ $(function () { customRequired() setRequired(customRequiredDom) } - if($('label[for=production_line_id]')) { - setRequired({table: [], label: ['label[for=production_line_id]']}) - } }, 500) customRequired() setRequired(customRequiredDom) diff --git a/jikimo_frontend/static/src/js/custom_image_temp.js b/jikimo_frontend/static/src/js/custom_image_temp.js index 60cc3425..fba97121 100644 --- a/jikimo_frontend/static/src/js/custom_image_temp.js +++ b/jikimo_frontend/static/src/js/custom_image_temp.js @@ -4,6 +4,8 @@ import { registry } from "@web/core/registry"; import { url } from "@web/core/utils/urls"; import { ImageField, imageCacheKey } from '@web/views/fields/image/image_field'; +const placeholder = "/web/static/img/placeholder.png"; + export class CustomImageField extends ImageField { setup() { super.setup(); diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss index a1605194..bc1be730 100644 --- a/jikimo_frontend/static/src/scss/custom_style.scss +++ b/jikimo_frontend/static/src/scss/custom_style.scss @@ -449,4 +449,21 @@ div:has(.o_required_modifier) > label::before { } } -} \ No newline at end of file +} + +// 更改表格底部按钮样式 +.o_list_renderer .o_field_x2many_list_row_add a,.treeHeaderBtn,.o_x2m_control_panel .o_cp_buttons .btn{ + display: inline-block; + margin: 5px 0; + font-size: 14px; + color: #71639e; + border: 1px solid #71639e; + padding: 0.2rem 0.6rem; + font-size: 1.08333333rem; + border-radius: 0.25rem; + transition: all .3s; +} +.o_list_renderer .o_field_x2many_list_row_add a:hover,.treeHeaderBtn:hover,.o_x2m_control_panel .o_cp_buttons .btn:hover{ + background: #71639e; + color: #fff +} diff --git a/jikimo_frontend/views/bye_odoo.xml b/jikimo_frontend/views/bye_odoo.xml new file mode 100644 index 00000000..0930f551 --- /dev/null +++ b/jikimo_frontend/views/bye_odoo.xml @@ -0,0 +1,35 @@ + + + + + +