Skip to content

Commit

Permalink
fixup! [MIG] hr_timesheet_portal to v14
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed Jan 17, 2025
1 parent 410cf0b commit 073724f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hr_timesheet_portal/static/src/js/hr_timesheet_portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ odoo.define("hr_timesheet_portal", function (require) {
}).then(this.proxy("_reload_timesheet"), this.proxy("_display_failure"));
},

_onclick_add: function () {
_onclick_add: function (e) {
var $currentTarget = jQuery(e.currentTarget);
if ($currentTarget.prop("disabled") || this.$("input").length) {
return;
}
$currentTarget.prop("disabled", true);
var self = this;
return this._rpc({
model: "account.analytic.line",
Expand Down Expand Up @@ -86,6 +91,7 @@ odoo.define("hr_timesheet_portal", function (require) {
if (!$existing_tbody.length) {
return self.$("thead").after($tbody);
}
self.$("h5").prop("disabled", false);
return self.$("tbody").replaceWith($tbody);
});
},
Expand All @@ -104,6 +110,7 @@ odoo.define("hr_timesheet_portal", function (require) {
_edit_line(line_id) {
var $line = this.$(_.str.sprintf("tr[data-line-id=%s]", line_id)),
$edit_line = $line.clone();
this.$("h5").prop("disabled", true);
this.$("tbody tr.edit").remove();
this.$("tbody tr").show();
$line.before($edit_line);
Expand Down

0 comments on commit 073724f

Please sign in to comment.