summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/field_registry.js
AgeCommit message (Collapse)Author
2019-04-02[IMP] web,account: editable list: no more position absoluteAaron Bohy
Before this rev., widgets were absolutely positioned in table cells. This cause an undesired effect with text fields, as their textarea overflowed and overlapped the next lines. With this rev., wigdets are now statically positioned, and the cells height and width don't change when switching a row to edit mode. Part of task 1915702
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch saas-11.3 up to ecd8c023b7cChristophe Simonis
2019-03-08[MERGE] forward port branch 11.0 up to e5f93b83c68Christophe Simonis
2019-03-07[FIX] web: add a fallback for `kanban_label_selection`Martin Geubelle
Before 11.0 the kanban view used to have its own widget registry. It is not the case anymore, but there are still leftovers from the past. For example, the widget `kanban_label_selection` is still used in many views, even though it is now called `label_selection`. As we are in a stable version, a fallback has been added for it in the field registry. Similar to odoo/odoo@5401c15 Closes odoo/odoo#30904 Closes odoo/odoo#25928
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-03-06[FIX] web: remove duplicated entry in field_registryAaron Bohy
Commit 4960453d added the field signature in field_registry.js and in signature.js. closes odoo/odoo#31434 Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com> closes odoo/odoo#31616 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-05[FIX] web: remove duplicated entry in field_registryAaron Bohy
Commit 4960453d added the field signature in field_registry.js and in signature.js. closes odoo/odoo#31434 Signed-off-by: =?utf-8?b?R8OpcnkgRGVib25nbmllIChnZWQp?= <ged@openerp.com>
2019-02-14[IMP] web Add widget signature on binary fieldjbm-odoo
Add a new widget for binary fields. It open a dialog box and the user can sign manually, or an signature can be draw automatically or he can upload a picture of his signature. Move fonts, controller, scss,templates about signature from portal to web to avoid redundance closes odoo/odoo#30222
2019-02-14[IMP] *: add mobile (native) barcode scanner for product fieldRomeo Fragomeli
This commit change widget to many2one_barcode in these views: - sale_order - purchase - invoice - expense In the fields register 'many2one_barcode' is mapped to many2one as fallback. many2one_barcode is implemented in odoo enterprise Task ID: 1924766 closes odoo/odoo#31018
2018-08-13[IMP] base, *: use a many2one for the company report layoutChristophe Matthieu
Before this rev. one could set the report layout on the company using a hardcoded list (background, clean, standard, etc.). Other modules (typically accounting modules) could add options in this list. The used template was built on the layout key. Now, the layout is a many2one field to a newly created model `report.layout`, which is linked to a view with the layout architecture. This gives more control to customize reports and create a new layout (without creating a python module that extend the layout selection).
2018-08-13[IMP] web: float_factor and float_toggle widgetsjem-odoo
This commit provides new js widgets for list, kanban and form views on float field. 1/ 'float_factor' displays the normal float field, but takes a conversion factor as option. The displays value is the normal one multiplied by the factor. You can use the widget like <field name="my_float_field" widget="float_factor" option="{'factor': 2}"/> 2/ 'float_toggle' displays a button (in edit mode) looping on a range of given value at each click. A conversion factor is optional (default will be 1) to display a converted value, but sent to non converted one to the server. You can use the widget like <field name="my_float" widget="float_toggle" option="{'range': [0, 0.5, 1], 'factor': 2}"/> 'range' and 'factor' are put in the options. In simple read mode, the widget display the value as a traditionnal text (like a normal char field). This commit provides tests and documentation for those 2 widgets. Task #39079
2018-06-27[MOV] web,im_livechat: Move clipboard widget to webYannick Tivisse
2018-05-30[IMP] web: add a badge based widget for selection fieldsSiddarth Gajjar
This commit introduces a new widget to be used for selection-based fields. Valid choices are displayed using rectangular badges and not like the standard list. This widget is valid for selection and many2one fields like selection or radio widgets. Co-authored-by: Siddarth Gajjar <sga@odoo.com> Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-05-15[IMP] web: add the Percentage widget in the registry as a basic fieldVincent Schippefilt
2018-04-23[MERGE] forward port branch saas-11.2 up to 7113b70762dChristophe Simonis
2018-04-19[FIX] web: use FieldText as fallback for html fieldsGéry Debongnie
Currently, the default field widget of type html is not defined in the web addon, but in the web_editor addon. It uses the summernote library and different assets. The web_editor addon is defined with auto_install=true, so it is usually not an issue. However, it could happen that there is some issue with the web_editor asset bundles. In that case, any form view with a field of type html will crash. With this commit, we define a default widget of type html in the web addon. This will render as text (so, not exactly what one might expect), but it is still better than making the web client unusable.
2018-02-12[MOV] web, mrp: move `pdf_viewer` widgetMartin Geubelle
This widget is generic enough to be used in other modules than mrp so we move it in the web module. Closes #22569
2018-01-12[FIX] web: binaryfile field in list viewsAlexandre Kühn
Revert partially 255e8ca3d92e3a77d7c2a145677623518bc2f978 Removed widget 'download_link', as it was a sub-version of widget 'binary': it did the exact same thing (representation of binary fields by means of a download link) in a much better-looking way (download icon + filename as text of the download link, instead of just a download link with text "Download"). Also, the values of binary fields might be already a human-readable binsize (e.g. 2.52 MBs), instead of its plain textual string representation in base64: The contextual parameter 'bin_size', when set to true, does not download the data of binary fields. As a consequence, the server provides the sizes of the binary, instead of their value.
2018-01-08[FIX] web: binary field format in list viewAlexandre Kühn
Binary fields were simply shown simply by their textual representation in list views, e.g. the base64 string. There was no formatter for binary fields, therefore it has been implemented so that it displays its estimated size. Binary fields in list views had a download link in v10.0. We provide this feature back by means of a widget called 'download_link'. It is also possible to define an option to set the field name having the filename as its value. Example: <tree> <field name="fname"/> <field name="datas" widget="download_link" options="{'filename': 'fname'}"/> </tree> with the following record: {fname: 'document.txt', datas: 'Cg=='}, we get a file named "document.txt" by clicking on the download link. Closes #21996
2017-09-25[ADD] web: link_button widgetMartin Trigaux
Add a widget to make a link to an external page in a tree view
2017-09-20[FIX] web,base: document template widget in settingsDeep Patel
Go to General Settings, click on 'Change Document Template', and in the opened dialog, click on a template. Before this rev., it automatically closed the dialog, which was not really convenient. This rev. introduces a new field widget (image_selection) for this use case, and ensures that the dialog doesn't close when a template is selected. Test written by @mba-odoo
2017-08-09[IMP] account: Add a new boolean_favorite widgetJigar Patel
Purpose ======= Projects and soon sales teams have a manual "favorite" button that calls a toggle_favorite method It should actually be a widget on a boolean field Specifications ============== Develop a favorite widget for kanban view that allows to toggle a boolean field Probably update boolean field to allow inverse method on it Functionally nothing changed.
2017-07-07[ADD] web: Add new widget to toogle a boolean with a sliderAnkit Sathvara
Purpose ======= Currently, it's not possible to activate a boolean on a non-editable list view without adding 2 buttons linked to a python method. These buttons aren't aligned and the result is not pretty. This commit adds a new widget that allows to toggle a boolean record by record by clicking on the slider.
2017-06-28[FIX] web: deal with reference fieldsMartin Geubelle
The reference fields haven't been correctly implemented with the new views. This commit restores their behaviour. Note that an small improvement has been introduced in this commit. Before saas-16, a `name_get` was done for each record (so 80 if the field was displayed in a full list view), which is not optimal. The calls are now batched by model (so one `name_get` by model appearing in the field values).
2017-05-04[REF] web, *: restore views designqsm-odoo
Since the new views merge, a lot of design elements were broken. This was particularly impacting the fields in the editable list view; indeed the editable list view is not using an inline form view anymore so the fields in the list were not properly styled as the LESS was still defined assuming the form view environment (for example the invalid fields were red for o2m fields in form view but not in editable list view even though they got the right CSS class). This commit refactor the LESS following these rules: - No more division of non-layout and layout rules. Dividing LESS rules in x_layout.less and x.less was a mistake. Many rules can be considered to be layout and not layout at the same time, developers always have to switch from one file part to the other, many CSS selectors (and rules!) are duplicated for nothing, ... - Field style is extracted from x_view.less and put in the new fields.less file. As before, the fields_extra.less will contain the rules specific to community so that the enterprise repo can override those by replacing the whole file. - Many classes have been renamed so that o_form_x_y becomes o_x_y as many classes can now be applied outside of form view. These classes should not be used in templates anyway. The commit also changes the DOM of fields so that it is more minimalist (no useless parent div, etc). Input elements are not automatically styled anymore, they have to get the o_input class explicitely. This allows to fix lots of small style bugs of previous versions (required monetary field had not the proper style, readonly m2m tags appeared as editable, ...). This also improves the LESS code. The editable list view should also completely stop flickering on chrome and firefox. The commit also removes the orange outline on list view dirty cells. The commit also removes deprecated static xml, LESS and other code. Notice there are still styles to restore/fix and LESS to improve.
2017-04-24[FIX] web: reintroduce many2many_binary field widgetMartin Geubelle
The field has been adapated to the new views. This commit also introduces some tests.
2017-04-21[FIX] website_event_track: fix state_selection widgets in viewsDavid Monjoie
Also add a deprecated fallback for similar widget calls in partner code.
2017-04-19[IMP] web: add timezone_mismatch field widgetChristophe Matthieu
* display a warning when the timezone offset is not the same of the browser timezone offset * if different, display the time in the selected timezone
2017-04-13[FIX] web(_editor): field widget htmlAaron Bohy
The field widget html wasn't implemented yet in the new views. A very basic implementation was done in addon web. It only handled the readonly mode so that the field were displayed in studio. This commit removes this basic implementation from web, and re- introduced the old one, converted, in addon web_editor.
2017-04-11[REM] web: remove id widgetDavid Monjoie
The original reason why this widget was created is because sometimes, the id is a virtual one, represented by string in the webclient. As such, the integer widget could not render it properly since it could not parse the integer from the string. This led to the following bug, which in turn led to the creation of the id widget: https://bugs.launchpad.net/openerp-web/+bug/919184 Now, virtual ids are not handled within the record data itself anymore, making it a non-issue to render the id field in the webclient since it is not given a value until a proper id is created. The virtual id management is completely out of the view scope now, rendering this widget useless.
2017-04-11[REF] web: use many2many tag widget in kanbanMartin Geubelle
Some commits haven't been correctly forward-ported, like https://github.com/odoo/enterprise/commit/2a3494a005f38baf2fd3db2c23844129e969e464 or https://github.com/odoo/enterprise/commit/5664a19045abed0cf900ef255bd3c96e16e8886c There purpose is to use the many2many tag widget in the kanban renderer instead of custom manipulation. The tests have also been adapted to correspond to the new tags.
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-04-11[REF] web, *: redesign all JS viewsGéry Debongnie
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm