mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update odoo_customize
This commit is contained in:
@@ -73,9 +73,10 @@
|
|||||||
'app_odoo_customize/static/src/scss/dialog.scss',
|
'app_odoo_customize/static/src/scss/dialog.scss',
|
||||||
# todo: fix,使用 owl 的 service
|
# todo: fix,使用 owl 的 service
|
||||||
'app_odoo_customize/static/src/js/user_menu.js',
|
'app_odoo_customize/static/src/js/user_menu.js',
|
||||||
# 'app_odoo_customize/static/src/js/ribbon.js',
|
'app_odoo_customize/static/src/js/ribbon.esm.js',
|
||||||
# 'app_odoo_customize/static/src/js/dialog.js',
|
# odoo 17内置窗口拖放,
|
||||||
# 'app_odoo_customize/static/src/webclient/*.js',
|
'app_odoo_customize/static/src/js/dialog.js',
|
||||||
|
'app_odoo_customize/static/src/webclient/*.js',
|
||||||
'app_odoo_customize/static/src/webclient/*.xml',
|
'app_odoo_customize/static/src/webclient/*.xml',
|
||||||
'app_odoo_customize/static/src/xml/res_config_edition.xml',
|
'app_odoo_customize/static/src/xml/res_config_edition.xml',
|
||||||
],
|
],
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 546 KiB After Width: | Height: | Size: 548 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 79 KiB |
@@ -20,7 +20,7 @@
|
|||||||
<section class="container app">
|
<section class="container app">
|
||||||
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h2 class="oe_slogan">This is a Long Term Support Apps.Update: v17.24.02.27</h2>
|
<h2 class="oe_slogan">This is a Long Term Support Apps.Update: v17.24.03.01</h2>
|
||||||
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">1. Deletes Odoo label in footer</li>
|
<li class="list-group-item">1. Deletes Odoo label in footer</li>
|
||||||
@@ -299,6 +299,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<h2 class="oe_slogan">This is a Long Term Support Apps.</h2>
|
<h2 class="oe_slogan">This is a Long Term Support Apps.</h2>
|
||||||
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
<div class="oe_demo" style=" margin: 30px auto 0; padding: 0 15px 0 0; border:none; width: 96%;">
|
||||||
|
<h3>Update: v17.24.03.01</h3>
|
||||||
|
<p>Add more function for odoo 17.Dialog, language switcher.</p>
|
||||||
|
<h3>Update: v17.24.02.26</h3>
|
||||||
|
<p>Fix bug for odoo 17 origin update.</p>
|
||||||
<h3>Update: v16.23.09.13</h3>
|
<h3>Update: v16.23.09.13</h3>
|
||||||
<p>UI enhance. follow odoo16 setup UI.</p>
|
<p>UI enhance. follow odoo16 setup UI.</p>
|
||||||
<p>46. Add Help documentation anywhere. easy get help for any odoo operation or action.</p>
|
<p>46. Add Help documentation anywhere. easy get help for any odoo operation or action.</p>
|
||||||
|
|||||||
@@ -4,21 +4,15 @@ import { Dialog } from "@web/core/dialog/dialog";
|
|||||||
import { patch } from "@web/core/utils/patch";
|
import { patch } from "@web/core/utils/patch";
|
||||||
import { session } from "@web/session";
|
import { session } from "@web/session";
|
||||||
|
|
||||||
patch(Dialog.prototype, "app_odoo_customize.Dialog", {
|
patch(Dialog.prototype, {
|
||||||
setup() {
|
setup() {
|
||||||
this._super.apply(this, arguments);
|
super.setup();
|
||||||
const app_system_name = session.app_system_name || "odooApp";
|
const app_system_name = session.app_system_name || "odooAi";
|
||||||
this.title = app_system_name;
|
this.title = app_system_name;
|
||||||
owl.onMounted(() => {
|
//odoo17 已内置 窗口可拖放
|
||||||
this.setDrag();
|
// owl.onMounted(() => {
|
||||||
});
|
// this.setDrag();
|
||||||
},
|
// });
|
||||||
setDrag() {
|
|
||||||
var $dl = $('#' + this.id + ' .modal-dialog .modal-content');
|
|
||||||
if ($dl)
|
|
||||||
$dl.draggable({
|
|
||||||
handle: ".modal-header"
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
68
app_odoo_customize/static/src/js/ribbon.esm.js
Normal file
68
app_odoo_customize/static/src/js/ribbon.esm.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/** @odoo-module **/
|
||||||
|
|
||||||
|
import {Component, xml} from "@odoo/owl";
|
||||||
|
import {useBus, useService} from "@web/core/utils/hooks";
|
||||||
|
import {registry} from "@web/core/registry";
|
||||||
|
|
||||||
|
export class WebEnvironmentRibbon extends Component {
|
||||||
|
setup() {
|
||||||
|
this.orm = useService("orm");
|
||||||
|
useBus(this.env.bus, "WEB_CLIENT_READY", this.showRibbon.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
|
||||||
|
validStrColour(strToTest) {
|
||||||
|
if (strToTest === "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (strToTest === "inherit") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (strToTest === "transparent") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const image = document.createElement("img");
|
||||||
|
image.style.color = "rgb(0, 0, 0)";
|
||||||
|
image.style.color = strToTest;
|
||||||
|
if (image.style.color !== "rgb(0, 0, 0)") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
image.style.color = "rgb(255, 255, 255)";
|
||||||
|
image.style.color = strToTest;
|
||||||
|
return image.style.color !== "rgb(255, 255, 255)";
|
||||||
|
}
|
||||||
|
|
||||||
|
showRibbon() {
|
||||||
|
const ribbon = $(".test-ribbon");
|
||||||
|
const self = this;
|
||||||
|
ribbon.hide();
|
||||||
|
// Get ribbon data from backend
|
||||||
|
self.orm
|
||||||
|
.call("web.environment.ribbon.backend", "get_environment_ribbon")
|
||||||
|
.then(function (ribbon_data) {
|
||||||
|
// Ribbon name
|
||||||
|
if (ribbon_data.name && ribbon_data.name !== "False") {
|
||||||
|
ribbon.show();
|
||||||
|
ribbon.html(ribbon_data.name);
|
||||||
|
}
|
||||||
|
// Ribbon color
|
||||||
|
if (ribbon_data.color && self.validStrColour(ribbon_data.color)) {
|
||||||
|
ribbon.css("color", ribbon_data.color);
|
||||||
|
}
|
||||||
|
// Ribbon background color
|
||||||
|
if (
|
||||||
|
ribbon_data.background_color &&
|
||||||
|
self.validStrColour(ribbon_data.background_color)
|
||||||
|
) {
|
||||||
|
ribbon.css("background-color", ribbon_data.background_color);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WebEnvironmentRibbon.props = {};
|
||||||
|
WebEnvironmentRibbon.template = xml`<div class="test-ribbon" />`;
|
||||||
|
|
||||||
|
registry.category("main_components").add("WebEnvironmentRibbon", {
|
||||||
|
Component: WebEnvironmentRibbon,
|
||||||
|
});
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
/* Copyright 2015 Sylvain Calador <sylvain.calador@akretion.com>
|
|
||||||
Copyright 2015 Javi Melendez <javi.melendez@algios.com>
|
|
||||||
Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
|
||||||
Copyright 2017 Thomas Binsfeld <thomas.binsfeld@acsone.eu>
|
|
||||||
Copyright 2017 Xavier Jiménez <xavier.jimenez@qubiq.es>
|
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
|
||||||
|
|
||||||
odoo.define("web_environment_ribbon.ribbon", function (require) {
|
|
||||||
"use strict";
|
|
||||||
var rpc = require("web.rpc");
|
|
||||||
var core = require("web.core");
|
|
||||||
|
|
||||||
// Code from: http://jsfiddle.net/WK_of_Angmar/xgA5C/
|
|
||||||
function validStrColour(strToTest) {
|
|
||||||
if (strToTest === "") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (strToTest === "inherit") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (strToTest === "transparent") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
var image = document.createElement("img");
|
|
||||||
image.style.color = "rgb(0, 0, 0)";
|
|
||||||
image.style.color = strToTest;
|
|
||||||
if (image.style.color !== "rgb(0, 0, 0)") {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
image.style.color = "rgb(255, 255, 255)";
|
|
||||||
image.style.color = strToTest;
|
|
||||||
return image.style.color !== "rgb(255, 255, 255)";
|
|
||||||
}
|
|
||||||
|
|
||||||
core.bus.on("web_client_ready", null, function () {
|
|
||||||
var ribbon = $('<div class="test-ribbon hidden"/>');
|
|
||||||
$("body").append(ribbon);
|
|
||||||
ribbon.hide();
|
|
||||||
// Get ribbon data from backend
|
|
||||||
rpc.query({
|
|
||||||
model: "web.environment.ribbon.backend",
|
|
||||||
method: "get_environment_ribbon",
|
|
||||||
}).then(function (ribbon_data) {
|
|
||||||
// Ribbon name
|
|
||||||
if (ribbon_data.name && ribbon_data.name !== "False") {
|
|
||||||
ribbon.html(ribbon_data.name);
|
|
||||||
ribbon.show();
|
|
||||||
}
|
|
||||||
// Ribbon color
|
|
||||||
if (ribbon_data.color && validStrColour(ribbon_data.color)) {
|
|
||||||
ribbon.css("color", ribbon_data.color);
|
|
||||||
}
|
|
||||||
// Ribbon background color
|
|
||||||
if (
|
|
||||||
ribbon_data.background_color &&
|
|
||||||
validStrColour(ribbon_data.background_color)
|
|
||||||
) {
|
|
||||||
ribbon.css("background-color", ribbon_data.background_color);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -4,11 +4,11 @@ import { WebClient } from "@web/webclient/webclient";
|
|||||||
import {patch} from "@web/core/utils/patch";
|
import {patch} from "@web/core/utils/patch";
|
||||||
import {session} from "@web/session";
|
import {session} from "@web/session";
|
||||||
|
|
||||||
patch(WebClient.prototype, "app_odoo_customize.WebClient", {
|
patch(WebClient.prototype, {
|
||||||
setup() {
|
setup() {
|
||||||
|
super.setup();
|
||||||
// 处理 navbar 全局可配置位置
|
// 处理 navbar 全局可配置位置
|
||||||
var self = this;
|
var self = this;
|
||||||
self._super.apply(this, arguments);
|
|
||||||
this.state.navbar_pos_pc = session.app_navbar_pos_pc || 'top';
|
this.state.navbar_pos_pc = session.app_navbar_pos_pc || 'top';
|
||||||
this.state.navbar_pos_mobile = session.app_navbar_pos_mobile || 'top';
|
this.state.navbar_pos_mobile = session.app_navbar_pos_mobile || 'top';
|
||||||
if (self.env.isSmall)
|
if (self.env.isSmall)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<template id="replace_copyright_name" name="Copyright Name" inherit_id="web.frontend_layout">
|
<template id="replace_copyright_name" name="Copyright Name" inherit_id="web.frontend_layout">
|
||||||
<xpath expr="//span[hasclass('o_footer_copyright_name')]" position="replace">
|
<xpath expr="//span[hasclass('o_footer_copyright_name')]" position="replace">
|
||||||
<span class="o_footer_copyright_name me-2">Copyright &copy;
|
<span class="o_footer_copyright_name me-2">Copyright &copy;
|
||||||
<span class="copyright_name_before" contenteditable="true">2009-2023 </span>
|
<span class="copyright_name_before" contenteditable="true">2009-2024 </span>
|
||||||
<span t-field="res_company.name" itemprop="name"/>
|
<span t-field="res_company.name" itemprop="name"/>
|
||||||
<span class="copyright_name_after" contenteditable="true"></span>
|
<span class="copyright_name_after" contenteditable="true"></span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<field name="priority">20</field>
|
<field name="priority">20</field>
|
||||||
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//app[@name='general_settings']" position="after">
|
<xpath expr="//app[@name='general_settings']" position="before">
|
||||||
<app class="app_settings_block ml8" data-string="OEM & Boost" string="OEM & Boost"
|
<app class="app_settings_block ml8" data-string="OEM & Boost" string="OEM & Boost"
|
||||||
name="app_odoo_customize" data-key="app_odoo_customize" logo="/app_odoo_customize/static/description/icon.png">>
|
name="app_odoo_customize" data-key="app_odoo_customize" logo="/app_odoo_customize/static/description/icon.png">>
|
||||||
<div class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25">
|
<div class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25">
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<!--点击模块看详情-->
|
<!--点击模块看详情-->
|
||||||
<xpath expr="//div[hasclass('oe_module_vignette')]" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade">
|
<xpath expr="//div[hasclass('oe_module_vignette')]" position="attributes" groups="app_odoo_customize.group_show_quick_upgrade">
|
||||||
<attribute name="class">oe_module_vignette oe_kanban_global_click</attribute>
|
<attribute name="class" position="add" separator=" ">oe_kanban_global_click</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!--让模块名更显眼-->
|
<!--让模块名更显眼-->
|
||||||
<xpath expr="//div[hasclass('oe_module_desc')]//code" position="replace"/>
|
<xpath expr="//div[hasclass('oe_module_desc')]//code" position="replace"/>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
|
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<setting id="appstore" position="attributes">
|
<setting id="appstore" position="attributes">
|
||||||
<attribute name="class">o_hidden</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
</setting>
|
</setting>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user