From c3ee7c8780f97b3fa151ce1c7b73ba27a6665f28 Mon Sep 17 00:00:00 2001 From: "Maruan Aguerdouh (magm)" Date: Wed, 1 Feb 2023 13:26:06 +0000 Subject: [PATCH] [FIX] sale_timesheet: description field of timesheet line fits to parent Steps to reproduce: - Install Sales, Project, Timesheets. - Go to a task inside Project, and to the Timesheets tab. - Create or modify a timesheet line, and write a very long description. Issue: The description field of the timesheet line is not fitting to the parent instead is fitting for the content inside description making the table bigger than it should. Solution: We have a custom widget for timesheet_ids field when we have sale_timesheet and the widget is missing the `o_field_one2many` class. So we add the proper class to the component with `TimesheetsOne2ManyField` opw-3145298 closes odoo/odoo#112631 X-original-commit: e73d7c4c3cddabdbb5d175681cbfe3789d846239 Signed-off-by: Xavier Bol (xbo) Signed-off-by: Maruan Aguerdouh Mohtar (magm) --- .../static/src/components/so_line_field/so_line_field.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/sale_timesheet/static/src/components/so_line_field/so_line_field.js b/addons/sale_timesheet/static/src/components/so_line_field/so_line_field.js index e26f2e937e7..00c4101ad8b 100644 --- a/addons/sale_timesheet/static/src/components/so_line_field/so_line_field.js +++ b/addons/sale_timesheet/static/src/components/so_line_field/so_line_field.js @@ -2,6 +2,7 @@ import { registry } from "@web/core/registry"; import { Many2OneField } from "@web/views/fields/many2one/many2one_field"; +import { X2ManyField } from "@web/views/fields/x2many/x2many_field"; export class SoLineField extends Many2OneField { setup() { @@ -17,5 +18,8 @@ export class SoLineField extends Many2OneField { } } -registry.category("fields").add('so_line_one2many', registry.category('fields').get("one2many")); // TODO: Remove me when the gantt view is converted in OWL +export class TimesheetsOne2ManyField extends X2ManyField {} +TimesheetsOne2ManyField.additionalClasses = ['o_field_one2many']; +registry.category("fields").add('so_line_one2many', TimesheetsOne2ManyField); // TODO: Remove me when the gantt view is converted in OWL + registry.category("fields").add("so_line_field", SoLineField);