Initial commit: Project packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit 89613c97b0
753 changed files with 496325 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/** @odoo-module **/
import fieldRegistry from 'web.field_registry';
import { FieldChar } from 'web.basic_fields';
export const FieldNameWithSubTaskCount = FieldChar.extend({
/**
* @override
*/
init() {
this._super(...arguments);
if (this.viewType === 'kanban') {
// remove click event handler
this.events = { ...this.events };
delete this.events.click;
}
},
_render: function () {
let result = this._super.apply(this, arguments);
if (this.recordData.allow_subtasks && this.recordData.child_text) {
this.$el.append($('<span>')
.addClass("text-muted ms-2")
.text(this.recordData.child_text)
.css('font-weight', 'normal'));
}
return result;
}
});
fieldRegistry.add('name_with_subtask_count', FieldNameWithSubTaskCount);

View file

@ -0,0 +1,25 @@
/** @odoo-module alias=project.project_private_task **/
"use strict";
import field_registry from 'web.field_registry';
import { FieldMany2One } from 'web.relational_fields';
import core from 'web.core';
const QWeb = core.qweb;
const ProjectPrivateTask = FieldMany2One.extend({
/**
* @override
* @private
*/
_renderReadonly: function() {
this._super.apply(this, arguments);
if (!this.m2o_value) {
this.$el.empty();
this.$el.append(QWeb.render('project.task.PrivateProjectName'));
this.$el.addClass('pe-none');
}
},
});
field_registry.add('project_private_task', ProjectPrivateTask);

View file

@ -0,0 +1,44 @@
/** @odoo-module **/
import { qweb } from 'web.core';
import fieldRegistry from 'web.field_registry';
import { FieldSelection } from 'web.relational_fields';
/**
* options :
* `color_field` : The field that must be use to color the bubble. It must be in the view. (from 0 to 11). Default : grey.
*/
export const StatusWithColor = FieldSelection.extend({
_template: 'project.statusWithColor',
/**
* @override
*/
init: function () {
this._super.apply(this, arguments);
this.color = this.recordData[this.nodeOptions.color_field];
this.hideLabel = this.nodeOptions.hide_label;
if (this.nodeOptions.no_quick_edit) {
this._canQuickEdit = false;
}
},
/**
* @override
*/
_renderReadonly() {
this._super.apply(this, arguments);
if (this.value) {
this.$el.addClass('o_status_with_color');
if (this.hideLabel) {
this.$el.attr('title', this.$el.text());
this.$el.empty();
}
this.$el.prepend(qweb.render(this._template, {
color: this.color,
}));
}
},
});
fieldRegistry.add('status_with_color', StatusWithColor);