Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] x2many_2d_matrix: add support of Related fields #2987

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

arnaudlayec
Copy link

This PR adds the support of pseudo-relational fields type "Reference" to x2many_2d_matrix.
See Odoo's ORM documentation about Reference fields.

Quite similarly to Many2one fields, the Reference fields' value and text must be fetched specificially.
This PR simply extends JavaScript conditions to test if fields are Many2one to add another condition to test if fields are Reference. If checked, text and value are retrieve correctly.
Example:

if (fieldType === "many2one") {
      column.text = column.value[1];
      column.value = column.value[0];
} else if (fieldType === "reference") {
      column.text = column.value.displayName;
      column.value = column.value.resId;
}

@OCA-git-bot
Copy link
Contributor

Hi @ChrisOForgeFlow,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants