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

[11.0][MIG] web_advanced_search_x2x #984

Closed
wants to merge 38 commits into from

Conversation

JBF91
Copy link
Contributor

@JBF91 JBF91 commented Jul 8, 2018

First attemp on migrating web_advanced_search_x2x, It wasn't easy, but it's working. I'm sure it can be improved.

The basics of this migration:

- Remove web_domain_v11 dependency
- Adapt how JS manage the fields, which has change a bit since 10.0

I'm open to apply any change in order to improve the code, I'm sure is far to be perfect.

hbrunn and others added 30 commits July 8, 2018 19:45
and replace company icon
I could not find the project on Transifex...
- Use the new domain widget.
- Use modules system.
When you were adding a custom filter in a x2x field using "contains", it always became "contains 'false'". Now it is fixed.
Before this patch, when a domain leaf was a string (such as `&`, `|` or `!`), it was being treated as an array. This was leading to errors such as this one:

```
2017-10-19 11:22:01,578 1 ERROR devel odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 677, in dispatch
    result = self._call_function(**self.params)
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 333, in _call_function
    return checked_call(self.db, *args, **kwargs)
    File "/opt/odoo/custom/src/odoo/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 326, in checked_call
    result = self.endpoint(*a, **kw)
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 935, in __call__
    return self.method(*args, **kw)
    File "/opt/odoo/custom/src/odoo/odoo/http.py", line 506, in response_wrap
    response = f(*args, **kw)
    File "/opt/odoo/auto/addons/web/controllers/main.py", line 827, in search_read
    return self.do_search_read(model, fields, offset, limit, domain, sort)
    File "/opt/odoo/auto/addons/web/controllers/main.py", line 849, in do_search_read
    offset=offset or 0, limit=limit or False, order=sort or False)
    File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4733, in search_read
    records = self.search(domain or [], offset=offset, limit=limit, order=order)
    File "/opt/odoo/custom/src/odoo/odoo/models.py", line 1559, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
    File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4275, in _search
    query = self._where_calc(args)
    File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4074, in _where_calc
    e = expression.expression(domain, self)
    File "/opt/odoo/custom/src/odoo/odoo/osv/expression.py", line 640, in __init__
    self.expression = distribute_not(normalize_domain(domain))
    File "/opt/odoo/custom/src/odoo/odoo/osv/expression.py", line 289, in distribute_not
    elif token in DOMAIN_OPERATORS_NEGATION:
TypeError: unhashable type: 'list'
```

Now they are treated specifically and the problem is fixed.��
@JBF91 JBF91 mentioned this pull request Jul 8, 2018
68 tasks
@yajo
Copy link
Member

yajo commented Jul 9, 2018

It has some problems:

  • Options "is equal to" and "is not equal to" do not use a many2one widget anymore.
  • When clicking a field in the domain selector, the whole search dropdown is hidden.

I have WIP branch around there, still not working fine too. Let me compare both and I'll try to get best changes from both. 😉

@JBF91
Copy link
Contributor Author

JBF91 commented Jul 9, 2018

@yajo I think my last commit fixes the dropdown hidding by prevent click event propagation.

@yajo
Copy link
Member

yajo commented Jul 20, 2018

It's finished: #999

Closing in favor of that, please review there. Thanks! 🙌

@yajo yajo closed this Jul 20, 2018
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.

None yet

10 participants