Skip to content

Commit

Permalink
[FIX] web, *: x2many list horizontal overflow
Browse files Browse the repository at this point in the history
Follow-up of odoo#121468

Since odoo@9f46224 (16.2), ´additionalClasses´ has to be added on the field
instead of the component.

closes odoo#122963

X-original-commit: 82228e6
Signed-off-by: Michaël Mattiello (mcm) <[email protected]>
  • Loading branch information
adr-odoo committed May 31, 2023
1 parent 854211c commit 42a458f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export class SectionAndNoteListRenderer extends ListRenderer {
SectionAndNoteListRenderer.template = "account.sectionAndNoteListRenderer";

export class SectionAndNoteFieldOne2Many extends X2ManyField {}
SectionAndNoteFieldOne2Many.additionalClasses = ['o_field_one2many'];
SectionAndNoteFieldOne2Many.components = {
...X2ManyField.components,
ListRenderer: SectionAndNoteListRenderer,
Expand All @@ -95,6 +94,7 @@ export class ListSectionAndNoteText extends SectionAndNoteText {
export const sectionAndNoteFieldOne2Many = {
...x2ManyField,
component: SectionAndNoteFieldOne2Many,
additionalClasses: [...x2ManyField.additionalClasses || [], "o_field_one2many"],
};

export const sectionAndNoteText = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ MrpProductionComponentsX2ManyField.components = {
...X2ManyField.components,
ListRenderer: MrpProductionComponentsListRenderer
};
MrpProductionComponentsX2ManyField.additionalClasses = ["o_field_many2many"];

export const mrpProductionComponentsX2ManyField = {
...x2ManyField,
component: MrpProductionComponentsX2ManyField,
additionalClasses: [...x2ManyField.additionalClasses || [], "o_field_many2many"],
};

registry.category("fields").add("mrp_production_components_x2many", mrpProductionComponentsX2ManyField);
2 changes: 1 addition & 1 deletion addons/resource/static/src/section_one2many_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ SectionOneToManyField.defaultProps = {
...X2ManyField.defaultProps,
editable: "bottom",
};
SectionOneToManyField.additionalClasses = ["o_field_one2many"];

registry.category("fields").add("section_one2many", {
...x2ManyField,
component: SectionOneToManyField,
additionalClasses: [...x2ManyField.additionalClasses || [], "o_field_one2many"],
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ MovesListRenderer.components = { ...ListRenderer.components, ViewButton: MoveVie

export class StockMoveX2ManyField extends X2ManyField {}
StockMoveX2ManyField.components = { ...X2ManyField.components, ListRenderer: MovesListRenderer };
StockMoveX2ManyField.additionalClasses = ['o_field_one2many'];

export const stockMoveX2ManyField = {
...x2ManyField,
component: StockMoveX2ManyField,
additionalClasses: [...x2ManyField.additionalClasses || [], "o_field_one2many"],
};

registry.category("fields").add("stock_move_one2many", stockMoveX2ManyField);
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ QuestionPageOneToManyField.defaultProps = {
...X2ManyField.defaultProps,
editable: "bottom",
};
QuestionPageOneToManyField.additionalClasses = ["o_field_one2many"];

export const questionPageOneToManyField = {
...x2ManyField,
component: QuestionPageOneToManyField,
additionalClasses: [...x2ManyField.additionalClasses || [], "o_field_one2many"],

};

registry.category("fields").add("question_page_one2many", questionPageOneToManyField);

0 comments on commit 42a458f

Please sign in to comment.