summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
AgeCommit message (Collapse)Author
2019-12-09[REV] web: reverts update to fontawesome 5.11.2Kevin Baptiste
This reverts commit ff1c35513aecef5fbc30f7c2f3834450e719714e. closes odoo/odoo#41480 X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc Related: odoo/enterprise#7110 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28[IMP] web: update to fontawesome 4.7.0 to 5.11.2Kevin Baptiste
FontAwesome 5 introduced new names for some icons as described on https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes This commit replaces the old names to the new ones. closes odoo/odoo#35826 Taskid: 2050241 Related: odoo/enterprise#5180 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-16[IMP] web: many2many_binary, binary, image, add the option ↵Debauche Stéphane
``accepted_file_extensions`` Purpose ======= We want to add an option on the widgets - many2many_binary, - binary, - image This option specifies what file extensions the user can pick from the file input dialog box. Examples ======== ```xml <field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/> <field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/> <field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/> <field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/> <field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/> ``` How === Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template) So, we can also use this new option in others widgets using ``HiddenInputFile`` In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions`` We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile`` (we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'`` The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF (instead of removing the <input/> and adding <input accept='.pdf'/>). Tests ===== We also test if the option is correctly set on the <input/> - binary - image - many2many_binary Impacted widgets =============== - many2many_binary - image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True`` - tablet_image: same as ``image`` Task #2082815 closes odoo/odoo#38351 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-10-16[IMP] web: increase file limit from 25mo to 64moGéry Debongnie
The fieldbinary widget has an internal max upload limit set to 25mo. This was set a long time ago, probably more than 5 years ago. Since then, a lot of things have changed and it may be more frequent for users to hit the limit. And it happens for some users, we had to increase locally their limit. Also, nginx is configured to accept files up to 64 mo, so it makes sense that the web client also uses that same limit. closes odoo/odoo#38856 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-10-11[IMP] web: CopyClipboardCharLong widget for long stringsArnaud Joset
- The copy CopyClipboardChar widget is not nicely rendered for very long strings (e.g. URL). - This commit modify the behavior of the CopyClipboardChar widget to display it nicely win such cases. TaskID: 2059972
2019-10-07[FIX] web: prevent browsers inputs autofillMathieu Duckerts-Antoine
We don't want the browser to fill inputs in the backend. Most of the time this is useless but sometimes it is even problematic. For example, focusing an input in a modal can trigger autofill not only in the modal but also in the whole page. If there is an input outside the modal and it is recognized by the browser as a candidate to fill, bad things occur. For that reason, we set the attribute autocomplete to "none" by default for input elements. Note that "off" does not work all the time because the browsers sometimes decide to ignore it. Task ID: 2076730 closes odoo/odoo#38039 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-25[FIX] web: allow line return in textareasJulien Mougenot
Before this commit, textareas in x2many would not allow line return when pressing enter. Now, it does.
2019-09-23[FIX] *: hide technical field widgets in non-debug mode (Studio)Juhil Somaiya
*: - account - barcodes - calenndar - hr_timesheet - mail - mass_mailing - partner_autocomplete - web - website_slides This commit removes description of fields that should not be shown in non-debug mode Studio. Only field widgets whose own description is set are displayed in non-debug mode Studio in "Widget" of sidebar. In other words, even if any ancestor has a description but not the current widget, it won't be displayed in the sidebar in non-debug mode. Task-Id 2056992 closes odoo/odoo#35902 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-09-20[FIX] web: field color: adapted for viewsJulien Mougenot
The FieldColor widget had been designed exclusively for the document layout configurator. Because of this, the widget would not display/behave correctly in other views. Before this commit: - in list views, the widget had a "white-space" attribute adapted for char fields, which gave it much more space than it needed - there was no handling of the widget in readonly state: it was always editable - its size in list views was a bit too large Now: - all styling problems have been adjusted for list views (unchanged for forms) - the widget is disabled when in readonly mode Task 2072466 closes odoo/odoo#36949 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-17[IMP] web: added increments to the minutes in daterangeJulien Mougenot
Minutes can now be chosen by increments of 5 instead of 10. Task 2068164
2019-09-20[MERGE] forward port branch saas-12.4 up to 4a1321bc99dChristophe Simonis
closes odoo/odoo#37127 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-17[MERGE] forward port branch saas-12.3 up to d8ce75466e4Christophe Simonis
2019-09-16[FIX] web: progress bar featureLucas Perais (lpe)
The progress bar was pretty broken before this commit. > It was not possible to input the value as text > Moving the progress bar to modify value and saving crashed > modifying the max value crashed > The whole feature was ill-defined With this commit, we fix the crashed. It is now possible to write the field behind the progress bar by moving it in RO mode or by typing the input in RW mode *if it is the value we want to write on* It it is the max value that the field targets, we can do it in RO and RW mode, only with the input as text Note that this works *only if* the editable option on the widget is set to true OPW 2061846 closes odoo/odoo#36928 closes odoo/odoo#36970 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com> Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-18[FIX] web: list: multi edit boolean with ENTERAaron Bohy
This rev. solves the similar issue as 801c603218, but with boolean fields. Scenario: select several records, select a boolean cell, press enter to change the boolean value. Task 2068280
2019-09-18[FIX] web: list: multi edit input of date(time) fieldsAaron Bohy
The Date(Time)Fields listen to 'input' and 'change' events (like all InputFields) to keep track of changes. However, the datepicker already listens to the 'change' event. As a consequence, in multi edition in a list view, if the user changed the value of a date(time) field by directly editing the input, the fieldChanged event was triggered twice, and there were 2 dialogs asking the user if he wanted to save the change. This rev. makes the Date(Time)Fields stop listening themselves to 'input' and 'change' events, and instead completely rely on the datepicker widget. Task 2068280
2019-09-09[IMP] web: edit translations in new dialogVincent Schippefilt
Before this commit, translations were edited in a list view with a filter on the field that needed to be translated. After this commit, the translations for each fields are translated in a dedicated dialog. The changes done to the current language are taken into account immediately, both ways, from the dialog to the form and from the form to the dialog. Translating terms is also available in create mode, the user will be prompted to save before editing a translation Task ID: 2028152 closes odoo/odoo#36185 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-05[FIX] base: Fix zoom on image fieldsKevin Baptiste
The goal of this commit is to adapt the zoom on image to the new names of the fields made by PR #4865. TaskID: 2049581
2019-09-05[FIX] web: kanban: global click and 'image' widgetAaron Bohy
Let's assume a kanban view with oe_kanban_global_click className (i.e. clicks on the card open the record in a form view), and an image with the 'image' widget. This is for instance the case of the hr.employee kanban view. Before this rev., clicking on the image didn't open the record in form view.
2019-08-08[MERGE] forward port branch saas-12.3 up to 752b2553c6fChristophe Simonis
2019-09-03[FIX] web: add a single pixel to handle in listsJulien Mougenot
Before this commit, handle was cropped in some views, showing an ellipsis instead of the actual handle. Now, handle has enough space to display properly. closes odoo/odoo#36387 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-08-27[FIX] web: crashmanager wrong syntax of arrow functionMohammed Shekha
arrow function used for error handler and error function is defined inside inner function so this will get changed, need to use self, also arrow function doesn't have its own arguments object, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions Issue raised from following commit: https://github.com/odoo/odoo/commit/2d6dc75a2cb5fa81189920d0f7fdc7b7f12132ab task-2052484 closes odoo/odoo#35788 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-23[REF] *,web: list: merge width and width_factor attrsAaron Bohy
Having two attributes for this was probably overkill. We now have a single attribute 'width' which can specify either a fixed width (e.g. '120px') or a factor (e.g. '2.5').
2019-08-07Revert "[FIX] web: hide dashboard tooltip on page change"Christophe Simonis
Mow that the Journal Dashboard use Chart.js, this patch is unneeded. This reverts commit 6d9dabd5d933c5cd6ba5a42103894d731a5689a0. Oversight of previous forward-port.
2019-08-06[MERGE] forward port branch saas-12.2 up to 9e74730a26bChristophe Simonis
2019-08-06[MERGE] forward port branch 12.0 up to ff9ddfdacc9Christophe Simonis
2019-08-14[MERGE] forward port branch saas-12.4 up to 98a55917a60Christophe Simonis
2019-08-13[ADD] web: add the language code in the translation widgetMartin Trigaux
The planet icon is not very clear for translation feature. Replace it with the code of the current language. Task-id: 2028152
2019-07-25[FIX] web: hide dashboard tooltip on page changeJulien Castiaux
Go to CRM/Sales/Team Pileline. Place your cursor on the chart, a tooltip appears, move your cusror away, the tooltip disappear. Now clic anywhere on the interface so the page change (i.e. on "x Open Opportunities") and quickly while the page loads place your cursor on the tooltip, it appears but when the page change it doesn't disappear. The problem here is that the graph element is removed from the DOM which prevent the correct handling of the `mousehover` event used internally by nv.d3 to show/hide the related tooltip. The solution is to manually hide the tooltip when the graph element is removed from the DOM. opw-2042286 closes odoo/odoo#35172 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-02[IMP] *: rename image fieldsSébastien Theys
image_original => image_1920 (now resized to 1920) image_big => image_1024 image_large => image_256 image_medium => image_128 image_small => image_64 image replaced by image_1920 (when writing) or by image_1024 (when displaying what was previously the big size) + add new intermediate format: image_512 PR: #34925
2019-07-29[FIX] web: fix error when image field can't load imageVincent Schippefilt
when image field cannot load an image, it will default to the placeholder image. If this placeholder image also cannot be loaded it was creating an infinite loop errors After this commit, we only show one error if the original image cannot be downloaded and if the placeholder cannot be downloaded, we don't show anything else. closes odoo/odoo#35226 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-27[MERGE] forward port branch saas-12.3 up to 0247d2f35fdChristophe Simonis
2019-06-27[MERGE] forward port branch saas-12.2 up to 465909f0fdeChristophe Simonis
2019-06-27[MERGE] forward port branch 12.0 up to cd21c016b06Christophe Simonis
2019-06-27[MERGE] forward port branch saas-11.3 up to 2f2bc67c067Christophe Simonis
2019-06-27[MERGE] forward port branch 11.0 up to b1d43cc80e2Christophe Simonis
2019-06-27[MERGE] forward port branch saas-15 up to d090c92782aChristophe Simonis
2019-06-14[MERGE] forward port branch saas-12.2 up to 498b4b4350dChristophe Simonis
2019-06-17[MERGE] forward port branch saas-12.3 up to 48a9f5a6335Christophe Simonis
2019-06-11[MERGE] forward port branch 12.0 up to 7ef4ba03c4fChristophe Simonis
2019-06-07[MERGE] forward port branch 11.0 up to bdc62d80314Christophe Simonis
2019-06-03[FIX] web: binary fields correctly resetsJulien Mougenot
When uploading a file to a binary file, then clicking on the "clear" button, then reuploading the same file... Before this commit: The actual input of the field was only changed on user input. This means that the "clear" action didn't reset the actual value of the input, and the browser's default behaviour when getting the same path twice is not to change anything. In the use case, you couldn't upload the same file until you uploaded another one. After this commit: The "clear" action now also clears the value, allowing reuploading the same file over again. closes odoo/odoo#33843 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-07[MERGE] forward port branch saas-11.3 up to a2582c4252aChristophe Simonis
2019-06-05[IMP] *: use new helper config.isDebug()Romain Derie
Before this commit, both config and session were aliases to odoo.debug. Now, config.isDebug() should be call, with possibility to pass a parameter to check if we are in a specific debug mode such as 'tests' or 'assets'. task-1934445 Coming with https://github.com/odoo/enterprise/pull/4281 Closes https://github.com/odoo/odoo/pull/33213
2019-07-30[FIX] web, *: make crash_manager use services correctlyfja-odoo
* = website_forum, stock Fix for: https://github.com/odoo/odoo/pull/32132 crash_manager.js was using the services while bypassing ServiceProviderMixin That means all services are duplicated, each having their own state. To fix this issue, CrashManager now extends AbstractService. Also crash_manager is now registered in serviceRegistry instead of being instanciated on the fly. The crash_manager now being a Service raise one issue with the tests: The services are not run for the tests but some tests needs the crash_manager 'unhandledrejection' listener. For that matter the services are reenable in qunit. Also the crash_manager's 'unhandledrejection' listener has to have precedence over the qunit listener as it will handle rejections wich have no reason or are not Errors. Part of: https://github.com/odoo/odoo/pull/35209
2019-07-29[IMP] base: Configure document layoutJulien Mougenot
The onboarding modal for setting up the few base fields of a company has now been moved to a wizard It is accessible from the general settings, but also in the onboarding section of sale and account modules. The following company settings are editable with that wizard: - Set report **layout**: The user can chose the overall look of the report. The current choices are : *Standard* (default), *Background*, *Boxed* and *Clean*. - Set company **logo**: Changes the company logo. - Set report **colors**: The user can set the primary and secondary colors of the report through a newly added widget allowing to pick a custom color. When changing the **logo**, colors are automatically set to its most dominant colors. > A "Reset colors" button also triggers the color calculation. - Set report **font**: Changes the overall font of the report. Only Google Fonts are used for enhanced compatibility. - Company **tagline**, also called "header" - **Footer** - **Paper format** - Report **preview**: A mockup of a final report Automatically updates when changing **layout**, **logo**, **colors** or **font** Co-authored by: Julien Mougenot <jum@odoo.com> closes odoo/odoo#33863 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com> Co-authored-by: Lucas Perais <lpe@odoo.com>
2019-07-19[FIX] web: FieldDomain: open selection with field contextAaron Bohy
Closes #33658 closes odoo/odoo#34989 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-18[IMP] web: add new date range picker field widgetJigar Patel
Adds a new widget to support start & end date or datetime. closes odoo/odoo#33266 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-12[REM] web: Remove toggle_button widgetYannick Tivisse
This widget is not used anymore, as all the stat buttons have been removed from the views.
2019-07-09[IMP] web: add simple calculator on numeric fieldsCedric Snauwaert
Add a new behavior to numeric fields, possibility to enter value manually or to use a simple arithmetic expression that will be evaluated. Example: =20+3*2 In order for the computation of the arithmetic expression to be done, the value needs to starts with = and then an expression can be entered. We only support the basics mathematical operations + - * / ( ) ^ User locale and digits separator are taken into account. If the value entered can't be evaluated to a numeric, the field will be displayed in error. closes odoo/odoo#34538 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-06[MERGE] forward port branch saas-12.2 up to 78b3b650b0dChristophe Simonis