Skip to content

[19.0][FIX] spreadsheet_oca: Allow adding relational field columns and rows - #141

Merged
OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-IMP-spreadsheet_oca
Oct 28, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:19.0from
Tecnativa:19.0-IMP-spreadsheet_oca

Conversation

@CarlosRoca13

Copy link
Copy Markdown

Before this changes we were not allowed to add childs of relational fields.

Now is added the arrow to see the child fields of a relational field, which give the possibility to add these fields to the dynamic table.

cc @Tecnativa TT65182

ping @pedrobaeza @christian-ramos-tecnativa

@christian-ramos-tecnativa christian-ramos-tecnativa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional review OK

@pedrobaeza pedrobaeza added this to the 19.0 milestone Oct 27, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

Thanks for the improvement. It's working well, but it's provoking a side effect: the measures list is now taking the same dialog as the rows/column ones, while it should be a special one. Please check it.

Before this changes we were not allowed to add childs of relational fields.

Now is added the arrow to see the child fields of a relational field, which give the possibility to add these fields to the dynamic table.

TT65182
@CarlosRoca13
CarlosRoca13 force-pushed the 19.0-IMP-spreadsheet_oca branch from 5beeba4 to 57a702e Compare October 27, 2026 12:28
@CarlosRoca13

Copy link
Copy Markdown
Author

Change done @pedrobaeza

*/
class PivotFieldSelectorPopover extends ModelFieldSelectorPopover {
canFollowRelationFor(fieldDef) {
return fieldDef.type === "many2one" && fieldDef.groupable;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not including many2many as well?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ORM only accepts many2one fields to traverse a groupby path (_read_group_groupby raises "Only many2one path is accepted" otherwise), as grouping through a x2many would duplicate rows and break the aggregates. Many2many fields can still be used directly as dimensions, just not followed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 19.0-ocabot-merge-pr-141-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit ce95b4c into OCA:19.0 Oct 28, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 57a2269. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza
pedrobaeza deleted the 19.0-IMP-spreadsheet_oca branch October 28, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants