mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2025-02-25 18:55:21 -06:00
[PATCH] Upstream patch - 17022023
This commit is contained in:
@@ -12,7 +12,7 @@ from pytz import timezone, utc
|
||||
|
||||
from flectra import api, fields, models, _
|
||||
from flectra.addons.base.models.res_partner import _tz_get
|
||||
from flectra.exceptions import ValidationError
|
||||
from flectra.exceptions import ValidationError, UserError
|
||||
from flectra.osv import expression
|
||||
from flectra.tools.float_utils import float_round
|
||||
|
||||
@@ -285,6 +285,9 @@ class ResourceCalendar(models.Model):
|
||||
self.hours_per_day = self._compute_hours_per_day(attendances)
|
||||
|
||||
def switch_calendar_type(self):
|
||||
if self == self.env.company.resource_calendar_id:
|
||||
raise UserError(_('Impossible to switch calendar type for the default company schedule.'))
|
||||
|
||||
if not self.two_weeks_calendar:
|
||||
self.attendance_ids.unlink()
|
||||
self.attendance_ids = [
|
||||
|
||||
@@ -868,6 +868,16 @@ const SelectUserValueWidget = BaseSelectionUserValueWidget.extend({
|
||||
*/
|
||||
async start() {
|
||||
await this._super(...arguments);
|
||||
if (!this.menuEl.children.length) {
|
||||
// Remove empty text nodes so that :empty css rule can work
|
||||
// TODO this has been added here as a fix to be extra careful. In
|
||||
// master we should just avoid adding text nodes inside
|
||||
// we-selection-items in the first place.
|
||||
while (this.menuEl.firstChild
|
||||
&& !this.menuEl.firstChild.data.trim().length) {
|
||||
this.menuEl.firstChild.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options && this.options.valueEl) {
|
||||
this.containerEl.insertBefore(this.options.valueEl, this.menuEl);
|
||||
|
||||
@@ -746,6 +746,9 @@ body.editor_enable.editor_has_snippets {
|
||||
background: none;
|
||||
}
|
||||
|
||||
we-toggler:empty::before {
|
||||
content: '/';
|
||||
}
|
||||
we-selection-items {
|
||||
@include o-position-absolute(100%, 0, auto, 0);
|
||||
z-index: $zindex-dropdown;
|
||||
@@ -755,7 +758,17 @@ body.editor_enable.editor_has_snippets {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
&:empty {
|
||||
line-height: $o-we-sidebar-content-field-dropdown-item-height;
|
||||
background-color: $o-we-sidebar-content-field-dropdown-item-bg;
|
||||
color: $o-we-sidebar-content-field-dropdown-item-color;
|
||||
// Padding from we-icon-button mixin.
|
||||
padding-left: 2 * $o-we-sidebar-content-field-control-item-spacing + $o-we-sidebar-content-field-control-item-size;
|
||||
|
||||
&::before {
|
||||
content: '/';
|
||||
}
|
||||
}
|
||||
> we-title {
|
||||
line-height: $o-we-sidebar-content-field-dropdown-item-height;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user