[FIX] account, web: restore single line layout for order line in edition
When the section and note fields were converted, the section and note text field ignored the list-specialisation of the text field, resulting in a textarea with a minimum height of 50 in list view which causes the line to be too high. It was also not using the o_field_text class which among other things hides the resize handle on the text area which looks weird in list view. This commit fixes that. closes odoo/odoo#102465 X-original-commit: 5735f89245f8efa980069973b3dbe94beac59061 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
+11
-1
@@ -3,7 +3,7 @@
|
||||
import { registry } from "@web/core/registry";
|
||||
import { ListRenderer } from "@web/views/list/list_renderer";
|
||||
import { X2ManyField } from "@web/views/fields/x2many/x2many_field";
|
||||
import { TextField } from "@web/views/fields/text/text_field";
|
||||
import { TextField, ListTextField } from "@web/views/fields/text/text_field";
|
||||
import { CharField } from "@web/views/fields/char/char_field";
|
||||
|
||||
const { Component, useEffect } = owl;
|
||||
@@ -82,6 +82,16 @@ export class SectionAndNoteText extends Component {
|
||||
}
|
||||
}
|
||||
SectionAndNoteText.template = "account.SectionAndNoteText";
|
||||
SectionAndNoteText.additionalClasses = ["o_field_text"];
|
||||
|
||||
export class ListSectionAndNoteText extends SectionAndNoteText {
|
||||
get componentToUse() {
|
||||
return this.props.record.data.display_type !== "line_section"
|
||||
? ListTextField
|
||||
: super.componentToUse;
|
||||
}
|
||||
}
|
||||
|
||||
registry.category("fields").add("section_and_note_one2many", SectionAndNoteFieldOne2Many);
|
||||
registry.category("fields").add("section_and_note_text", SectionAndNoteText);
|
||||
registry.category("fields").add("list.section_and_note_text", ListSectionAndNoteText);
|
||||
|
||||
@@ -80,7 +80,7 @@ TextField.extractProps = ({ attrs, field }) => {
|
||||
|
||||
registry.category("fields").add("text", TextField);
|
||||
|
||||
class ListTextField extends TextField {
|
||||
export class ListTextField extends TextField {
|
||||
get minimumHeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user