Commit Graph
301 Commits
Author SHA1 Message Date
Christophe Simonis 58a83d1222 [MERGE] forward port branch saas-12.4 up to 4a1321bc99
closes odoo/odoo#37127

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-20 14:33:54 +00:00
Christophe Simonis 080f8b1f96 [MERGE] forward port branch saas-12.3 up to d8ce75466e 2019-09-17 17:49:09 +02:00
Lucas Perais (lpe) fa283d3d4e [FIX] web: progress bar feature
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-16 15:28:25 +00:00
Aaron Bohy 708a5b6566 [FIX] web: list: multi edit boolean with ENTER
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 11:31:43 +00:00
Aaron Bohy 34e5271d7b [FIX] web: list: multi edit input of date(time) fields
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-18 11:31:43 +00:00
Vincent Schippefilt 029dd1a214 [IMP] web: edit translations in new dialog
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-09 13:09:53 +00:00
Kevin Baptiste 2df9d021e1 [FIX] base: Fix zoom on image fields
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 07:34:33 +00:00
Aaron Bohy f60db9b93a [FIX] web: kanban: global click and 'image' widget
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-09-05 07:34:33 +00:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Julien Mougenot 71805ff41d [FIX] web: add a single pixel to handle in lists
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-09-03 13:49:57 +00:00
Mohammed Shekha 6952ee18bc [FIX] web: crashmanager wrong syntax of arrow function
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-27 12:13:43 +00:00
Aaron Bohy 4393b012a5 [REF] *,web: list: merge width and width_factor attrs
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-23 06:28:34 +00:00
Christophe Simonis c687bd9aed Revert "[FIX] web: hide dashboard tooltip on page change"
Mow that the Journal Dashboard use Chart.js, this patch is unneeded.

This reverts commit 6d9dabd5d9.

Oversight of previous forward-port.
2019-08-07 16:29:42 +02:00
Christophe Simonis 7d04dc1c7c [MERGE] forward port branch saas-12.2 up to 9e74730a26 2019-08-06 18:48:24 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Martin Trigaux bdec8efabf [ADD] web: add the language code in the translation widget
The planet icon is not very clear for translation feature.
Replace it with the code of the current language.

Task-id: 2028152
2019-08-13 14:12:17 +00:00
Julien Castiaux 6d9dabd5d9 [FIX] web: hide dashboard tooltip on page change
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-07-25 09:14:45 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
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-08-02 16:47:58 +00:00
Vincent Schippefilt ba1f4dc381 [FIX] web: fix error when image field can't load image
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-07-29 09:24:18 +00:00
Christophe Simonis 5e81b18e24 [MERGE] forward port branch saas-12.3 up to 0247d2f35f 2019-06-27 20:45:52 +02:00
Christophe Simonis 6c5783bd5a [MERGE] forward port branch saas-12.2 up to 465909f0fd 2019-06-27 19:10:09 +02:00
Christophe Simonis 465909f0fd [MERGE] forward port branch 12.0 up to cd21c016b0 2019-06-27 18:01:07 +02:00
Christophe Simonis cd21c016b0 [MERGE] forward port branch saas-11.3 up to 2f2bc67c06 2019-06-27 17:24:24 +02:00
Christophe Simonis 2f2bc67c06 [MERGE] forward port branch 11.0 up to b1d43cc80e 2019-06-27 14:40:32 +02:00
Christophe Simonis b1d43cc80e [MERGE] forward port branch saas-15 up to d090c92782 2019-06-27 14:25:31 +02:00
Christophe Simonis 34a8754d4f [MERGE] forward port branch saas-12.2 up to 498b4b4350 2019-06-14 15:20:01 +02:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Christophe Simonis 8853e6b594 [MERGE] forward port branch 12.0 up to 7ef4ba03c4 2019-06-11 15:20:13 +02:00
Christophe Simonis a2582c4252 [MERGE] forward port branch 11.0 up to bdc62d8031 2019-06-07 13:00:07 +02:00
Julien Mougenot d7d7d92e92 [FIX] web: binary fields correctly resets
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-03 15:01:57 +00:00
Christophe Simonis 9e9e9acef1 [MERGE] forward port branch saas-11.3 up to a2582c4252 2019-06-07 19:04:43 +02:00
Romain Derie 72f7139f52 [IMP] *: use new helper config.isDebug()
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-06-05 05:56:33 +00:00
fja-odoo 2d6dc75a2c [FIX] web, *: make crash_manager use services correctly
* = 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-30 15:57:14 +00:00
Julien MougenotandLucas Perais ed18095127 [IMP] base: Configure document layout
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-29 08:29:26 +00:00
Aaron Bohy c1eec46f7e [FIX] web: FieldDomain: open selection with field context
Closes #33658

closes odoo/odoo#34989

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-19 12:23:10 +00:00
Jigar Patel cda93a5c19 [IMP] web: add new date range picker field widget
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-18 12:13:34 +00:00
Yannick Tivisse 52fc9a24a6 [REM] web: Remove toggle_button widget
This widget is not used anymore, as all the stat buttons have been removed
from the views.
2019-07-12 13:01:36 +02:00
Cedric Snauwaert 9cab694bf5 [IMP] web: add simple calculator on numeric fields
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-07-09 07:45:42 +00:00
Christophe Simonis a97037c6d4 [MERGE] forward port branch saas-12.2 up to 78b3b650b0 2019-05-06 12:27:51 +02:00
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Kevin Baptiste 83aaea9e5c [IMP] base: Add option on image widget to enable zoom
Purpose
=======

As the employee picture on a form view is often too small,
it should be possible to zoom on it like for products in eCommerce.

Specification
=============

Added new bool options on FieldBinaryImage: `zoom` and `background`.

`zoom` will call zoomOdoo.js and display a popup with the zoomed out
image.

`background` is used to either display the image as a div element with
a background-url (to be used e.g. in a kanban view) or as a standard
img element.

closes odoo/odoo#33839

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-26 06:56:17 +00:00
Parth Choksi 00997c93a9 [FIX] web: pdf file not previewed
The pdf_viewer widget fails to load file and hence shows error.
This is due to the wrong controller called(wrong URI passed),
while loading a file using pdfjs.

For files other than images, /web/content controller should
be called since since odoo/odoo#31811.

This is similar to the enterprise fix 793c76298a2b301a2

task-1932190

closes odoo/odoo#33354

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-22 13:07:21 +00:00
Sébastien Theys 9dec7ba7e9 [IMP] web, *: add utils to get dataURL (base64) from file/blob
* = partner_autocomplete, point_of_sale, web_editor,
website_forum, website_slides

This can be used for example to preview an image from a file input field.

It can also be used to send the base64 content of the input by RPC instead of
having to rely on form submit as POST with multipart/form-data.

Technically wrap FileReader.readAsDataURL in a Promise.

This will also be used in task-1930726

PR: #33508

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-21 11:37:20 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Priyanka Kakadiya b2df3c7f30 [FIX] web: removed extra space from graph
- when refresh a kanban dashboard page which contains graph, there is some extra div appends to the graph.
- so if svg is there in the dom, no need to append it again. simply use the existing svg

Related to Issue: 1943483

closes odoo/odoo#32279

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-04-03 11:23:24 +00:00
Martin Geubelle 05d3048511 [FIX] web: correctly display list column name
Rev. odoo/odoo@5dc971b introduced a `description` attribute on AbstractField.

Sadly, the attribute was already used for something else (in `handle`
and a widget in asset, to hide the column name). So the widget new
description is now displayed in the list header (instead of the field
name).

A new attribute `noLabel` has been now added on AbstractField (currently
only used in list) to fill the same purpose as the previous `description`.

Task 1981757

closes odoo/odoo#33060

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-07 09:34:28 +00:00
Aaron Bohy d0164d834b [IMP] web,account: editable list: no more position absolute
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-04-02 11:55:57 +00:00
Aaron BohyandMartin Geubelle 9fbb4fb44f [IMP] web: editable list: table-layout: fixed
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.

The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).

Part of task 1915702

Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-04-02 11:55:57 +00:00
Denis Ledoux fd0a10026c [MERGE] forward port branch saas-12.1 up to b11930047f 2019-05-02 09:45:14 +02:00