mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-26 21:12:02 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,128 @@
|
|||
.o_automation_kanban {
|
||||
.o_kanban_renderer.o_kanban_ungrouped .o_kanban_record {
|
||||
flex: 0 0 100%;
|
||||
width: unset;
|
||||
margin: 0px;
|
||||
> div {
|
||||
border: none;
|
||||
}
|
||||
.o_automation_kanban_box {
|
||||
display: flex;
|
||||
.o_automation_kanban_card {
|
||||
width: 600px;
|
||||
max-width: 600px;
|
||||
}
|
||||
.o_automation_kanban_extra {
|
||||
flex-direction: column;
|
||||
width: 10rem;
|
||||
}
|
||||
.o_automation_kanban_position_line {
|
||||
border-right: 3px dotted $gray-300;
|
||||
top: -0.5rem;
|
||||
bottom: 0.5rem;
|
||||
width: 8.75rem;
|
||||
position: absolute;
|
||||
}
|
||||
.o_automation_kanban_card_position {
|
||||
position: absolute;
|
||||
top: 1.5rem;
|
||||
text-align: right;
|
||||
width: 9.125rem;
|
||||
}
|
||||
.o_automation_kanban_time {
|
||||
flex-direction: column;
|
||||
.o_automation_kanban_time_info {
|
||||
border: 1px solid $gray-300;
|
||||
width: 7rem;
|
||||
}
|
||||
}
|
||||
.o_automation_kanban_card {
|
||||
border: 1px solid $gray-300;
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
flex-shrink: 0;
|
||||
flex-direction: column;
|
||||
.o_automation_kanban_header {
|
||||
position: relative;
|
||||
.o_automation_kanban_header_icon {
|
||||
display: inline-block;
|
||||
padding: 3px 7px;
|
||||
margin: 5px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.o_automation_kanban_header_title {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: auto;
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
right: auto;
|
||||
}
|
||||
.o_automation_kanban_header_actions {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
right: 0px;
|
||||
}
|
||||
}
|
||||
.o_automation_kanban_graph {
|
||||
.o_automation_kpi_processed {
|
||||
color: #4caf50;
|
||||
}
|
||||
.o_automation_kpi_error {
|
||||
color: #f44336;
|
||||
}
|
||||
}
|
||||
.o_automation_kanban_child_add {
|
||||
.o_automation_kanban_child_add_title {
|
||||
padding: 2px;
|
||||
}
|
||||
.o_automation_kanban_child_add_buttons {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.o_automation_kanban_child_add:hover {
|
||||
.o_automation_kanban_child_add_buttons {
|
||||
display: flex;
|
||||
.o_automation_kanban_child_add_button {
|
||||
cursor: pointer;
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
flex-shrink: 0;
|
||||
flex-direction: column;
|
||||
border: 1px solid $gray-300;
|
||||
}
|
||||
}
|
||||
}
|
||||
.o_automation_kanban_states {
|
||||
display: flex;
|
||||
.o_automation_kanban_state {
|
||||
padding: 0.5rem;
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
flex-shrink: 0;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid $gray-300;
|
||||
border-right: 1px solid $gray-300;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.o_automation_kanban_state:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.o_field_automation_graph {
|
||||
width: 100%;
|
||||
}
|
||||
.filter-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {KanbanCompiler} from "@web/views/kanban/kanban_compiler";
|
||||
|
||||
export class AutomationKanbanCompiler extends KanbanCompiler {
|
||||
setup() {
|
||||
super.setup();
|
||||
this.compilers.push({
|
||||
selector: ".o_automation_kanban_child_add_button[t-att-trigger-type]",
|
||||
fn: this.compileHierarchyAddButton,
|
||||
});
|
||||
}
|
||||
compileHierarchyAddButton(el) {
|
||||
el.setAttribute(
|
||||
"t-on-click",
|
||||
"() => this.addNewChild({trigger_type: " +
|
||||
el.getAttribute("t-att-trigger-type") +
|
||||
"})"
|
||||
);
|
||||
return el;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {AutomationKanbanCompiler} from "./automation_kanban_compiler.esm";
|
||||
import {KanbanRecord} from "@web/views/kanban/kanban_record";
|
||||
|
||||
export class AutomationKanbanRecord extends KanbanRecord {
|
||||
addNewChild(params) {
|
||||
this.env.onAddActivity({
|
||||
context: {
|
||||
default_parent_id: this.props.record.data.id,
|
||||
default_trigger_type: params.trigger_type,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
AutomationKanbanRecord.Compiler = AutomationKanbanCompiler;
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {AutomationKanbanRecord} from "./automation_kanban_record.esm";
|
||||
import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
|
||||
|
||||
export class AutomationKanbanRenderer extends KanbanRenderer {
|
||||
/*
|
||||
Here we are going to reorder the items in the proper way and
|
||||
we will show the items with the proper padding
|
||||
*/
|
||||
getGroupsOrRecords() {
|
||||
return this._sortRecordsHierarchy(this.props.list.records, false).map(
|
||||
(record) => ({
|
||||
record,
|
||||
key: record.id,
|
||||
})
|
||||
);
|
||||
}
|
||||
_sortRecordsHierarchy(records, parent_id) {
|
||||
return records.flatMap((record) => {
|
||||
if (!record.data.id) {
|
||||
return [];
|
||||
}
|
||||
if (record.data.parent_id && record.data.parent_id[0] !== parent_id) {
|
||||
return [];
|
||||
}
|
||||
if (!record.data.parent_id && parent_id) {
|
||||
return [];
|
||||
}
|
||||
return [record, ...this._sortRecordsHierarchy(records, record.data.id)];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
AutomationKanbanRenderer.components = {
|
||||
...AutomationKanbanRenderer.components,
|
||||
KanbanRecord: AutomationKanbanRecord,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue