diff --git a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.esm.js b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.esm.js
index c4f14faaf9..2d6b5bf6e5 100644
--- a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.esm.js
+++ b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.esm.js
@@ -22,6 +22,18 @@ patch(X2Many2DMatrixRenderer.prototype, {
return columns;
},
+ _getRows() {
+ const rows = super._getRows(...arguments);
+ if (this._knownRowValues) {
+ for (const row of rows) {
+ row.isNewlyAdded = !this._knownRowValues.has(row.value);
+ this._knownRowValues.add(row.value);
+ }
+ }
+ this._knownRowValues = new Set(rows.map((r) => r.value));
+ return rows;
+ },
+
_getCellClass(column, rowValue) {
const x = this.columns.findIndex((c) => c.value === column.value);
const y = this.rows.findIndex((r) => r.value === rowValue);
@@ -33,6 +45,10 @@ patch(X2Many2DMatrixRenderer.prototype, {
};
},
+ _getRowClass(row) {
+ return {o_matrix_new_row: row.isNewlyAdded};
+ },
+
_getColumnTotalClass(column) {
return {o_matrix_today: column.isToday};
},
diff --git a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.scss b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.scss
index 359e3b130e..d3dae58bbb 100644
--- a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.scss
+++ b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix.scss
@@ -8,6 +8,10 @@
background-color: rgba($info, 0.2);
}
+ .o_matrix_new_row {
+ background-color: rgba($info, 0.2);
+ }
+
.o_matrix_value_nonzero {
font-weight: bold;
}
diff --git a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix_renderer.xml b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix_renderer.xml
index 5a3dcad996..9f80b9415d 100644
--- a/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix_renderer.xml
+++ b/hr_timesheet_sheet/static/src/components/timesheet_matrix/timesheet_matrix_renderer.xml
@@ -9,6 +9,10 @@
{o_matrix_today: column.isToday}
+
+ _getRowClass(row)
+
+
_getCellClass(column, row.value)