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

web_advanced_search_x2x automatically excludes inactive records #179

Closed
clonedagain opened this issue Jul 17, 2015 · 6 comments
Closed

web_advanced_search_x2x automatically excludes inactive records #179

clonedagain opened this issue Jul 17, 2015 · 6 comments
Labels

Comments

@clonedagain
Copy link

If I use web_advanced_search_x2x for example in reporting>invoice analysis, to search for articles with certain features (for example a specific pricelist), it automatically also restricts to the active articles only.
Inactive articles are excluded and can't be re-included afterwards.
If want to include inactives, I must search for products with "my criteria AND (active=true OR active=false)".

It would be nicer to not exclude inactive records by default.

@hbrunn
Copy link
Member

hbrunn commented Jul 17, 2015

This is odoo's standard behavior, to change this, we'd have to put {'active_test': False} into the context by default. I dont think this is a good idea, because then we'd also see objects that are inactive for good reasons.

@clonedagain
Copy link
Author

I'm not convinced it's right to accept and extend Odoo's default behavior in this case.
The behavior users expect is that the main model is filtered on "Active=True", not the related models.
i.e. when a partner is inactive, you can still find it's related invoices.

The problem is that, as it is now, the implicit criteria "active=True" makes the "user experience" inconsistent.
For example:

  • search for invoices in period X => finds results for all partners
  • search for invoices in period X and partner "in selection (category = 'ABCD')" => finds results for only the active partners in the category ABCD

Would you be kind enough to reconsider your position?

@pedrobaeza
Copy link
Member

I agree with @clonedagain about the reasoning on the feature, but I think that there's a technical problem to implement this correctly. @hbrunn, is this correct?

@hbrunn
Copy link
Member

hbrunn commented Jul 30, 2015

In most cases, it should be enough to put active_test: False in the context, analyze the current search domain if it contains the active field, the model if it has an active field, and finally add ('active', '=', True) if all this checks go right.
But still, we'll run into subtle weirdnesses as described in odoo/odoo#3939 - especially the explanation linked in the second last post.

I simply don't think there's a general way to exclude inactive records we actually don't want to see while including other active records we do want to see, and making this explicit doesn't seem like a big issue to me, so from my side, I won't invest time in addressing this. If somebody else will, I'll be happy to review.

@pedrobaeza
Copy link
Member

Well, looking at the issue, this is only due to the child_of operator and the partner hierarchy implementation, which is not one of the allowed in the advanced search, so I still think that we can provide this facility in the module, and 99% of cases will be correctly treated.

@hbrunn hbrunn added the wontfix label Nov 20, 2015
@hbrunn
Copy link
Member

hbrunn commented Nov 20, 2015

wontfix for reasons stated above

@hbrunn hbrunn closed this as completed Nov 20, 2015
vrenaville pushed a commit to camptocamp/web that referenced this issue Jul 19, 2018
…_group_editable_on_Internal_transfer

[BSMTS-300][IMP] Procurement group editable on Internal transfer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants