Commit Graph
5 Commits
Author SHA1 Message Date
Carlos RocaandAaron Bohy c6b0248b5f [FIX] web: SearchView of many2one is not getting the form domain
Steps to reproduce the problem:

1. Add a many2one field to lines of a model, example: sale.order.line
2. Add it to form view of the lines with a domain
3. Click on Search more... option
4. You will see results out of the scope of the domain

In the getDomain is passed an object that has only the key
fieldName but for knew in what view is the field placed
it needs to be provided the key viewType, this both are placed
on the class object this.recordParams builded at:
https://github.com/odoo/odoo/blob/b8a5175b6c92749bd3bb7b9f869b1ecff78e133f/addons/web/static/src/legacy/js/fields/relational_fields.js#L129

If this key is not provided the viewType is beeing filled
with the element viewType, this element is the record opened placed
in the parent view, so by default if will be kanban or list. So
if the domain is filled just in the form view, the search panel
will get the domain [], so all the entries will be displayed and
they will be able to be selected.

If we see the next line:
https://github.com/odoo/odoo/blob/b8a5175b6c92749bd3bb7b9f869b1ecff78e133f/addons/web/static/src/legacy/js/fields/relational_fields.js#L431
We will see that getContext is getting this.recordParams as
argument, for the same reason that the domain should have it.

With this changes the getDomain method is getting the viewType
to take the domain instead of the viewType of the lines displayed
on the parent view.

closes odoo/odoo#163513

X-original-commit: 1eef2e8711124df9cbe7373ef6056b51f1b2617c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2024-04-26 18:54:33 +00:00
Carlos Roca 00edf79a8d [IMP] event_sale: export classes of model and record of event configurator
Exporting the EventConfiguratorRelationalModel and EventConfiguratorRecord
classes allows us to easily extend them into other modules. This will
allow us to add functionality to the event wizard of the sales lines without
doing tricks.

closes odoo/odoo#130521

X-original-commit: a597fb19b4bec4403f9f31eb141d3053c3b755cb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-02 17:29:23 +02:00
Carlos Roca 72edf3c885 [IMP] event_sale: Allow extend event configurator to write more fields than 2 defined.
Before this change, if you tried to extend the event configurator to add new fields,
it was not possible because only the two defined fields (event_id and event_ticket_id)
were updated.

After this change, all fields that are returned in the closeInfo.eventConfiguration
will be updated.

This is useful to avoid redefining the _openEventConfigurator function again and
to make this functionality more extensible.

closes odoo/odoo#128792

X-original-commit: 0002d38dd074a537568b4aba4588b285c06356d9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-18 11:42:37 +02:00
CarlosRoca13 488d6e97de [IMP] website_sale: Make options of _search_with_fuzzy inheritable
Before this change we would have to use other ways to add filtering forms in e-commerce. For example, using the context of the request in 'product.template' to catch what we need in the _search_get_detail method.

After these changes, we will not need to pass the context of the request outside the controller because it will be the _search_with_fuzzy options that will give us the information we need for inheritance.

closes odoo/odoo#94858

X-original-commit: d29f2f3ac5f8c3e8109287e0933609bdbe0cadb1
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-29 15:55:33 +02:00
Carlos Roca 1ff825c012 [CLA] update Tecnativa signature
closes odoo/odoo#67262

X-original-commit: 42291b957ba4f33640c99097be73f16aa9e06d47
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-03-04 15:02:06 +00:00