summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets/model_field_selector.js
AgeCommit message (Collapse)Author
2020-06-12[IMP] *: update notifications to optional titleJulien Mougenot
closes odoo/odoo#52826 Related: odoo/enterprise#11084 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-09[FIX] web: properly set page data in 'ModelFieldSelector' widgetshreya thakrar
When passing a default field chain to ModelFieldSelector, the page data is not set correctly for the relational field. To understand the issue : - login to v11 enterprise all db branch in runbot (debug mode recommended) - create a mass mailing, add subject, select 'Contact' in `Recipients` field - click on domain selector and select 'Company' from ModelFieldSelector popover - click somewhere else to close the popover - again open domain selector and observe the popover Current behavior : fields of `Contact` are visible in the page even thogh `Company` is selected in the ModelFieldSelector Expected behavior : fields of `Company` should be visible This commit fixes the issue by correctly pushing the page data in ModelFieldSelector. task - 2058702 closes odoo/odoo#47231 X-original-commit: 5746c2705c324b124445f38ead4f75624b3f99e3 Related: odoo/enterprise#9124 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-08-09[FIX] web: add support for TRUE_LEAF and FALSE_LEAF in ModelFieldSelectorJinal Patel
before this commit, domain selector widget does not support TRUE_LEAF and FALSE_LEAF i.e. [(1, '=', 1)] and [(0, '=', 1)] respectively, the reason is the chain part of the domain i.e. field name has value 1/0 and we don't have field name like 1 and 0 in domain and hence ModelFieldSelector don't accept it after this commit, domain selector can handle this special two domains which is [(1, '=', 1)] and [(0, '=', 1)], add support for chain with 1/0 in ModelFieldSelector task- 1998145 closes odoo/odoo#35603 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-03-06[REF] web: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-01-08[IMP] web: use `showSearchInput` in model field selectorMartin Geubelle
The option `showSearchInput`, which is used on the model field selector to display a search input that filters the displayed fields, is not set by default. This includes the model field selector instantiated in the `domain` field widget. closes odoo/odoo#29986
2018-10-15[IMP] web: add `showSearchInput` option on ModelFieldSelectorMartin Geubelle
The option `showSearchInput` has been added on the ModelFieldSelector to allow the user to easily filter the displayed fields. An input is displayed in the popover title. The search method is fuzzy for optimal results. closes odoo/odoo#27788
2018-08-13[FIX] web: can focus out then focus in when currently being selectedChristophe Matthieu
Before this fix, in studio when the user select the field then focus out then focus in and selected a child field, an exception is triggered because the last page is visible but the data are removed. A test in enterprise (web_studio) is added with this commit.
2018-08-13[IMP] web: add more filtering and sorting options on ModelFieldSelectorChristophe Matthieu
A new `filter` option has been added to filter fields with an optional function. A new `order` option has been added to sort displayed fields. The `followRelations` options have also been extended to take a function.
2018-07-27[REF] *: BS4, adapt display classesqsm-odoo
The system completely changed. I also had to adapt classes to new screen breakpoints. hidden/hide -> d-none show -> d-block hidden-xs -> d-none d-md-(block/inline/...) hidden-sm -> d-md-none d-lg-(block/inline/...) hidden-md -> d-lg-none d-xl-(block/inline/...) hidden-lg -> d-xl-none visible-xs-* -> d-* d-md-none visible-sm-* -> d-none d-md-* d-lg-none visible-md-* -> d-none d-lg-* d-xl-none visible-lg-* -> d-none d-xl-* hidden-print -> d-print-none visible-print-* -> d-none d-print-* ... and all possible combination of those had to be handled too.
2017-11-02[FIX] web: FieldSelector: add model in field attributesMartin Geubelle
The key `model` was missing in the FieldSelector selected fields. The model can be useful for example to create a one2many related field.
2017-10-31[FIX] web: FieldSelector: always keep first pageMartin Geubelle
In the FieldSelector, after clearing the chain and closing the popover, the very first page was removed from the widget `pages`. This was causing issue when trying to select a new field again. This commit ensures that the first page is not sliced.
2017-09-26[FIX] web: untranslated fields in widget domainMartin Trigaux
The user context was not propagated so the list of fields was untranslated.
2017-06-08[FIX] web: ModelFieldSelector: add a way to clear the cacheAaron Bohy
The ModelFieldSelector keeps an internal cache for the fields_get. This cache needs to be cleared in the tests environment because a model with the same name may be defined several times accross the tests modules, but they may contain different fields. This could also be a problem with studio: when a field is created, the ModelFieldSelector cache must be cleared as well (in addition to the data_manager one). We thus introduce a new 'clear_cache' event on core.bus. When triggered, the ModelFieldSelector and the data_manager clear their respective cache. We use this event in the test environment to ensure that the cache is cleared at the end of each test using a mockEnvironment. This rev. also fixes an infinite loop in the override of destroy() in the mockEnvironment, which occured when both session and config were specified in the params.
2017-04-11[IMP] web: domain & field selector usability (+ design)qsm-odoo
+ Document and refactor the files using the new guidelines * Now only non-technical names are used when building field chains and domains (technical names can be used in debug mode). * Better warnings are displayed when using the field and/or domain selector widgets (also checks domain validity in both domain field AND domain selector widget). Also improve design (thanks to original work of @stefanorigano): - Hovering 'remove' highlights the element that will be removed - Hovering 'add node' btns shows where the new node will be created - Restyle debug domain input field (make it similar to a text editor) - Improve design and layout - Resize inner fields
2017-04-11[REF] web, *: simplify our RPC system (in JS)Géry Debongnie
The RPC system was not completely satisfactory, we decided to prepare the future and do it properly. This commit introduces the new rpc system, which replace the previous new one. We now simply have a method, this._rpc, which takes a dictionary of parameters. The idea is that depending on the parameters, it is able to add correct default value when necessary. For situations where we don't have the this._rpc method, we can use the rpc.query method, which takes the same arguments, but directly calls ajax.rpc instead of triggering up some events.
2017-04-11[REF] *: use _rpc method for all rpcsGéry Debongnie
The _rpc method is now the preferred method to do a rpc, so we need to update all calls.
2017-04-11[REF] web, *: remove calls to performmodelrpcGéry Debongnie
The this.performModelRPc method is deprecated, so with this commit, we remove some calls.
2017-04-11[IMP] web: adapt field domain to new APIqsm-odoo
Add the implementation of the "FieldDomain" (widget='domain') in basic fields file.
2017-03-01[MERGE] forward port branch saas-14 up to eddefc9948bChristophe Simonis
2017-02-13[FIX] web: change selected field value on chain shorteningqsm-odoo
Before this commit, when opening a field chain with a field selector and only removing parts of it, the field selector internal "chain" value was properly updated but not its "selectedField" value.
2017-02-10[MERGE] forward port branch saas-14 up to be9dfb331f9Christophe Simonis
2017-02-03[FIX] web: properly notify field chain change on shorteningqsm-odoo
Before this commit, when opening a field chain with a field selector and only removing parts of it and closing, the field selector was not notifying the change.
2017-02-03[FIX] web: handle field selector closing/opening correctlyqsm-odoo
Ironically, clicking on the dropdown arrow of the field selector was the only way which was not opening the dropdown. It was indeed added as pure design element. This commit handles the opening and closing of the dropdown in a more robust way... while simplyfing the code too.
2017-01-31[IMP] web: add options to field selector to filter the fieldsqsm-odoo
Before this commit, the field selector had an unique option to filter the fields it displays: filters.searchable, which tells the widget to only display the searchable fields (which is the default). Now there are two more options: - fields: an explicit list of the fields to use (if null, let the widget get the fields itself (this is the default)) - followRelations: a boolean which is true if the user can follow relation to build a field chain (default to true) These options are needed by Web Studio in enterprise where domain construction for form view attrs can only use fields which are in the view and do not follow relations.
2017-01-31[FIX] web: document domain selector options correctlyqsm-odoo
The "ModelFieldSelector" widget has a "filters" option which can customize the fields which are displayed. The "DomainSelector" widget has of course the same option it can transmit to its internal "ModelFieldSelector" instance... but it was documented as "fs_filters" instead of "filters". Also, let the "ModelFieldSelector" document its own options and sets their defaults (instead of the "DomainSelector" widget).
2017-01-03[IMP] web, *: add new Domain and Field selection widgetsqsm-odoo
* base_action_rule, gamification, mass_mailing 1) Create the independant DomainSelector widget - Allow to build a prefix char domain 2) Replace old FieldCharDomain with a new FieldDomain which uses the new DomainSelector widget 3) Create the independant ModelFieldSelector widget - Allow to build a valid field chain for a specific model (e.g 'partner_id.name' for a 'res.users') - Used by DomainSelector widget --- The DomainSelector widget uses a tree-like representation with user-friendly buttons (ALL/ANY/+/-/...). Any domain can be built, except those containing the "!" (not) operator or some operators like "like", "child_of" (@see DomainSelector). However, if the user enters these in the debug input, the widget can handle them. Note: these widgets had to do unusual stuff the widget API does not allow to handle efficiently right now but it will be adapted to the new widget/field API in a further update. Note2: the widgets also have possibility of other improvements like supporting m2o input instantiation in DomainLeaf, etc. --- This work is an adaptation of the original code made by @pga-odoo.