pengyuthon wechat

This commit is contained in:
李鹏宇
2024-11-22 21:02:55 +08:00
parent 03b818e8ff
commit 7467bfe0b6
6 changed files with 70 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
+17
View File
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
{
'name': 'Breadcrumb To Back Button',
'summary': 'Breadcrumb To Back Button',
'description': 'Breadcrumb To Back Button',
'author': 'XSK',
'website': '',
'category': 'Tools',
'version': '17.0',
'depends': ['base'],
'assets': {
'web.assets_backend': [
'breadcrumb_to_back_button/static/src/**/*',
],
},
}
@@ -0,0 +1,13 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { ControlPanel } from "@web/search/control_panel/control_panel";
patch(ControlPanel.prototype, {
onBreadcrumbBackClicked(ev) {
const jsId = this.breadcrumbs[this.breadcrumbs.length - 2].jsId;
this.onBreadcrumbClicked(jsId);
}
});
@@ -0,0 +1,3 @@
.breadcrumb-back-div {
display: flex;
}
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-inherit="web.Breadcrumbs" t-inherit-mode="extension">
<xpath expr="//ol[hasclass('breadcrumb')]" position="attributes">
<attribute name="style">display: none !important;</attribute>
</xpath>
<xpath expr="//div[@t-if='collapsedBreadcrumbs.length || visiblePathBreadcrumbs.length']/div[last()]" position="attributes">
<attribute name="style">display: none !important;</attribute>
</xpath>
<xpath expr="//ol[hasclass('breadcrumb')]" position="after">
<div class="breadcrumb-back-div">
<button t-if="breadcrumbs.length" class="btn btn-secondary o_attach" t-on-click="(ev) => this.onBreadcrumbBackClicked(ev)" data-tooltip="BACK">
<i class="fa fa-chevron-left"/>
返回
</button>
<div class="d-flex gap-1 text-truncate">
<div class="o_last_breadcrumb_item active d-flex gap-2 align-items-center min-w-0 lh-sm">
<span class="min-w-0 text-truncate" t-call="web.Breadcrumb.Name"/>
</div>
<t t-call="web.Breadcrumb.Actions"/>
</div>
</div>
</xpath>
</t>
</templates>
+8
View File
@@ -0,0 +1,8 @@
# odoo\addons\hr_attendance\models\hr_employee.py
# hours = sum(
# att.worked_hours or 0
# for att in employee.attendance_ids.filtered(
# lambda att: att.check_in >= start_naive and att.check_out and att.check_out <= end_naive
# )
# )
hours = 0 # 上月工作小时