Skip to content

Conversation

@ThiagoMForgeFlow
Copy link
Contributor

Maintaining this part of code can occur a visual issue. If the result variable has 80 records (default by Odoo) and the orig_ids is less than result, Odoo only shows the orig_ids, and we lost the previous work finding next records.

In a multicompany environment, if you only enable one company you won't see all the records that you should. Real example:

  1. With only one company active you don't see all the records of that company.
screen1
  1. You can only access all the records activiating all the companies.
screen2

Do the same logic proposed in 15: OCA/edi#1147

@ForgeFlow

@OCA-git-bot
Copy link
Contributor

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

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

Can we have a test ?
To ensure that:

  1. final ordering is respected
  2. company visibility fix works

Gracias! :)

@etobella
Copy link
Member

@ThiagoMForgeFlow gentle reminder

Maintaining this part of code can occur a visual issue. If the result variable has 80 records (default by Odoo) and the orig_ids is less than result, Odoo only shows the orig_ids, and we lost the previous work finding next records.
@ThiagoMForgeFlow
Copy link
Contributor Author

Hi @simahawk and @etobella,

First of all, my apologies for the delayed response — I have been busy. I have just added a test that checks exactly what I mention in the PR. In this test, 100 edi.exchange.record records are created:

  • The first 60 are linked to a res.partner record belonging to one company.
  • The next 20 are linked to a res.partner record belonging to a new company.
  • The last 20 are linked to a res.partner record belonging to the same company as the first one.

Then, when performing a search with a limit of 80 (simulating Odoo view pagination), with only the first company active and using a non-superuser, the expected result is the first 60 records and the last 20. Keeping the line of code proposed to be removed in this PR, the actual result is only the first 60 records, because the additional 20 records (from the second pagination) are not part of orig_ids and therefore are not included in the final result:
result = [x for x in orig_ids if x in result]

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.

5 participants