Commit Graph
13616 Commits
Author SHA1 Message Date
qsm-odoo f16113a06e [IMP] web_editor, *: review the editor design CSS
*: web, mass_mailing, website, website_form, website_sale

New CSS design of the editor (step 1/x).

This work is unfortunately far from perfect but is a first step towards
what we want. In particular, much CSS linked to elements that are meant
to be removed/moved in the upcoming weeks was done in a huge rush but
will thus hopefully be removed/reviewed before the 14.0 release.

As the design is now far more complex including gradients and other
"complex" elements, it was also very difficult to keep a design based on
css-variable so this system was removed, which means that the editor now
appears the same everywhere (backend, frontend, ...). The original goal
of this system was to have an adapted style for backend, frontend and
website visitors. Unfortunately, the current result was a very good
frontend editor design, a not-so-good backend editor design (for mass
mailing at least) and a totally unadapted design for the website
visitors. Making this perfect will be achievable by loading different
assets for those 3 areas and hopefully those assets will only differ by
the values of editor scss variables.

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
Julien Mougenot 55408fd01b [FIX] web: Properly handle default favorite filters
Before this commit, the default active favorite filter was determined by
its ID given by the control panel. These IDs start at index 0, meaning
that if a condition checks for the value of such an ID, it could be
false even though the ID and its filter exists.

Now the indexation starts at 1 to avoid such problems.

closes odoo/odoo#54435

X-original-commit: cfb7bbea1b428a062ee08ca045509d189b1fd1d4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-14 10:55:59 +00:00
Julien Mougenot 669c2ebaec [IMP] web: improve eval context dates
This commit handles 2 things:

1) the merging of the `py_utils.context()` into the evaluation context
returned by `BasicModel._getEvalContext` to access the same time-related
keys,

2) the addition of 2 new keys into the `py_utils.context` (thus
transmitted to the basic model): `today` (an alias for the already
present `current_date`) and `now` which represents the current date and
time value.

Task 2269697
2020-07-14 09:10:32 +00:00
qsm-odoo b9ad60d5eb [FIX] web_editor, web: fix traceback with drag & drop when no header
Commit [1] introduced the bug by relying on the fact an element with
id=top is in the edited DOM. As the website header can be disabled, this
induced a crash as soon as the header was indeed disabled. Also, the
editor is not meant to edit the website only so we cannot rely at all
on the presence of a #top element.

[1]: https://github.com/odoo/odoo/commit/6df67a28c2f113572acd4a3db19ab6b1bd37e7da

closes odoo/odoo#54409

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-13 15:24:07 +00:00
Aaron Bohy b558cb7996 [FIX] web: qweb old inheritance mechanism
Before this commit, defining a extension of a template by using the
combination of directives 't-name' and 't-extend' ignored potential
extensions that could have been defined beforehand.

For instance, let's assume the following templates.
```xml
<t t-name="a">
    <div><span>1</span></div>
</t>
<t t-extend="a">
    <t t-jquery="span" t-operation="replace">
        <span>2</span>
    </t>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
```
Rendering template "b" displayed "1b" whereas we would expect "2b".

Moreover, when the extended template is itself an extension of
another template:
```xml
<t t-name="a">
    <div><span>a</span></div>
</t>
<t t-name="b" t-extend="a">
    <t t-jquery="div" t-operation="append">
        <span>b</span>
    </t>
</t>
<t t-name="c" t-extend="b">
    <t t-jquery="div" t-operation="append">
        <span>c</span>
    </t>
</t>
```
Rendering template "a" displayed "a", template "b" displayed "ab",
but template "c" displayed "ac", whereas we would expect "abc".

With this commit, other extensions done to a template are kept when
a new extension is defined. It relies on the templates order, and
takes into account all extensions that have *already* been defined.
This is exactly how the new qweb inheritance mechanism (using
't-inherit' and 't-inherit-mode') behaves.

closes odoo/odoo#54315

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-10 11:53:23 +00:00
Aaron Bohy af85bb5e13 [IMP] web,*: do not deploy services in tests
*mail,point_of_sale,web_editor,website

In the tests, required services are deployed for each test
independently. There is no need to have, in additon, all services
deployed globally. Worse, it could conflict and lead to unexpected
results.

This commit ensures services are no longer deployed globally in
tests. It turns the module 'web.env' into a declarative module with
no side-effect, by moving the service deployment to main.js, which
isn't added to the tests page.

Task 2287397

closes odoo/odoo#53817

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-13 12:55:07 +00:00
Xavier Morel 350ed97c45 [FIX] web: async operations should not live in init
Support for the "allow exports" group was implemented by checking the
group in init(), which is sync. Move that check over to willStart
instead.

Also add a default mock for user_has_group (makes it so it always
replies that the user doesn't have the group), and override that
specifically for the group we're interested in in the export tests, so
those tests have access to the Export action / option.

closes odoo/odoo#54254

X-original-commit: 30968ac93373990338c23f49e678d272b8e60c6b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-09 07:23:04 +00:00
jvm-odoo ccea563abb [FIX] web: fix zoomodoo attachToTarget/dashboard compatible
Issue

    - Install Employees & Dashboard
    - Add employees to kanban
    - Dashboard
    - Hover an employee picture

    There is only the picture visible
    on the page, the remaining space is white.

Cause

    I found several issues.

    1. The pictures are not shown on hover in employees
        But they are on dashboard.

    2. $attach = all `.content` and on dashboard there is
        2 `.content` so the flyout is append 2 times

    3. The move method is trigerred on hover too, it hides
        the flyout if we are not in it. But with attachToTarget
        we are not in it so it's hidden all time.

    4. If everything above is solved, the image is shown but
        not at the correct position because the flyout base
        position is not top 0, left 0

Solution

    1. Reduce the minimum required size to 128px
    2. use closest instead of parents
    3. Don't hide if we have the option attachToTarget
    4. Calculate the flyout offset and replace it correctly
       and set it to position fixed to handle scrolling

OPW-2291493

closes odoo/odoo#54333

X-original-commit: 2c6d692ee40c97d2ae63da64db7623702948407e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-10 13:48:20 +00:00
jvm-odoo 8eb47d8165 [FIX] web: fix optional columns list dropdown
Issue

	- Accounting > General ledger
	- Have 2-3 lines in the table
	  I added filters to have them
	- Toggle optional columns: (...) on the right

	There is an y scroll but you can't scroll
	more than half of the scrollbar.

Cause

	The cause is that the dropdown height is greater
	than the table height.

Solution

	Use data-display: static this way the element doesn't
	scroll with parent scroll and scrolling is working
	as expected on the dropdown

OPW-2291531

closes odoo/odoo#54320

X-original-commit: 9afd7b7ec7461a47ea8d7fbbd4884c24e1af9865
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-10 10:48:19 +00:00
qsm-odoo 3783b3855d [FIX] web: remove forgotten console.log
Commit [1] merged a debug console.log. This commit removes it.

[1]: https://github.com/odoo/odoo/commit/6df67a28c2f113572acd4a3db19ab6b1bd37e7da

Part of https://github.com/odoo/odoo/pull/54311

closes odoo/odoo#54311

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-10 09:52:30 +00:00
qsm-odoo 7be1429656 [REF] website, *: review how available fonts are defined in scss
*: web, web_editor

Instead of three lists + one map to define font information and user
choices saved as the index of the related fonts in those lists, the
fonts are now stored in an unique map <font-name> -> <data> and the
user choices are saved as the font name. This allow to have a visually
better definition of the fonts and allows to reorder fonts in the UI
without losing user customization (and actually simplify some code).

Unfortunately any user font customization < 14.0 will be lost, but this
is a small price to pay (users can still rechoose the same font in the
editor UI where they will go anyway to discover all the new shiny
features we are introducing there).

Part of https://github.com/odoo/odoo/pull/54065
task-2291398

closes odoo/odoo#54065

Related: odoo/design-themes#269
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-09 18:09:59 +00:00
qsm-odoo ec026e76ca [FIX] web: remove test-breaking css property
This is a huge mistery. But this particular `align-items: baseline`
rule, introduced by [1], yields a red runbot ~20% of the time.

As it is not stricly necessary in current master (but necessary if the
font changes which will be the case in the upcoming days), this commit
simply removes the rule temporarily.

[1]: https://github.com/odoo/odoo/commit/94b59b1972e1a18e18dfcd6c2ded495391380b9a

Part of https://github.com/odoo/odoo/pull/54274

closes odoo/odoo#54274

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-09 16:20:22 +00:00
Joseph Caburnay 259cf45346 [FIX] web: trying to create record based on name_create w/o _rec_name
There are orm models that don't have _rec_name defined. The orm doesn't
allow creation of record via name_create if _rec_name is not defined in
the model. This commit considers this fact, such that if name_create
returns false, we don't proceed on displaying the non-existing record.

Note: _rec_name defaults to 'name' if not specified so only few models
don't have _rec_name.

closes odoo/odoo#54270

Task-id: 2285036
X-original-commit: 676c2b8e4fdf7347d44bc5afb7ca51d39338a527
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-09 12:43:36 +00:00
Aaron Bohy 9d99e75453 [FIX] web: list: don't squeeze button columns
Adjacent buttons are not displayed in a single column. When the
table overflows, we try to squeeze largest columns to make it fit
into its container (in this case, text may be clipped and an
ellipsis is displayed). Button columns didn't get away from this.

As a consequence, now that a cell may contain several buttons,
some of them may be clipped and replaced by the ellipsis, which
isn't what we want for buttons.

This commit removes the button columns from the list of columns
to squeeze, so we let the browser reduce them as much as it can,
and we keep them as they are.

Task 2282470

closes odoo/odoo#54258

X-original-commit: e00960daa3ed3d1fd3a7572b2acedd3d2fb0448e
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-09 08:54:28 +00:00
Laurent Stukkens (LTU) 6df67a28c2 [REF] web_editor,web: reuse the autoscroll on drag feature
Prior to this commit, the autoscroll on drag feature was accessible and only
used in the web_editor application.

After this commit, the autoscroll on drag feature will be available in the
web application and has been refactored in order to allow its usage
in other application (as for the sign application).

task-2280965

closes odoo/odoo#54072

Related: odoo/enterprise#11656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-08 12:13:33 +00:00
jvm-odoo e4235a8d16 [FIX] web: fix zoomodoo flyout width
Issue

	- Install eCommerce
	- Modify a product image with one which
	  has more than 1024px width/height to
	  enable zoom (I used: https://bit.ly/2VETQZS)
	- Go on the website preview & hover the image

	Depending on the screen size, a part of the
	flyout is hidden because of overflow-x
	if you want to see it, you should scroll
	right width right arrow key.

Cause

	The flyout has 100% width and is put
	right (position absolute, left: 100%)

Solution

	To avoid this error on all screen size,
	the solution is to compute the max-width
	of the flyout depending on the available
	space on the right.

OPW-2283648

closes odoo/odoo#54222

X-original-commit: c89b4c25ed92542f6fd0279cf3a9e4ef1bac9fa5
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-08 11:39:09 +00:00
Aaron Bohy e55ee0bb1b [FIX] web: kanban: drag column with sample data
Before this commit, in a grouped kanban view with sample data (e.g.
crm.lead), one could toggle the 'settings' dropdown menu of a
group, and then drag&drop the group by clicking on the muted "Fold"
item in the dropdown.

After this commit, dragging a column is only possible by clicking
on the column title (but not on the 'config' or '+' icons, nor the
config dropdown).

Task 2290197

closes odoo/odoo#54179

X-original-commit: 58c38a024c96eba3469c142a8422b7bd0ab54ea4
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-07 10:14:54 +00:00
Julien Mougenot cd1d339763 [FIX] web: Make sample server tests deterministic
Before this commit, there were a few tests in the "sample server" suite
that asserted that every group resulting of a "read_group" would contain
at least one record, while there was actually a slight chance of it not
happening.

Now, the sample server used in the tests has been rendered deterministic
and these kind of issues are completely avoided.

closes odoo/odoo#54164

X-original-commit: a6d32ff46558b68ce3f19458f29c311ee5c658fd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-07-07 08:33:28 +00:00
Hardik Prajapati 8e91b0ad3b [FIX] web: properly display boolean fields in kanban
Before this commit, boolean fields (without widget="boolean") in
kanban views were displayed as [Object object], because when no
widget is specified, we display the (textual) formatted value of
the field. However, the boolean formatter returns by default a
string encoding an html checkbox.

This commit passes the correct option to force a string formatting,
so it now displays "True" or "False". Moreover, this commit
uniformizes formatter options for that purpose, as another option
had been recently introduced for monetary field.

Note that those options should not be necessary, as formatters
should always return text values (no html). But this is a larger
change, that we might do in the future.

Task 2280394

closes odoo/odoo#53937

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-07 09:17:37 +00:00
qsm-odoo 94b59b1972 [FIX] web, web_editor, *: review chess-like bg for transparency preview
*: website

The style to achieve the chess-like bg result was duplicated at many
places. The 'web' app was also actually using an image from the
'web_editor' app (we can live with it in stable as web_editor always
comes with web in auto_install but this was still a mistake).

closes odoo/odoo#54154

Also: fix some layout issue in the colorpicker widget.
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-06 15:47:06 +00:00
Xavier ALT 2479da0176 [FIX] web: do no try to render filters referencing access restricted fields
In case a field is limited to specific groups on the model, those fields
are discarded from `fields_view_get()` but can still be referenced by some
filters on the search view causing a traceback (see #53797)

Model:

```python

class MyModel(models.Model):

  my_field = fields.Char(groups='base.group_system')
```

Search views:

```xml
<search string="My Model">
    <filter name="group_myfield" context="{'group_by': 'my_field'}"/>
</search>
```

This commit ensure those filter are correctly discarded.

OPW-2284621

closes odoo/odoo#54112

X-original-commit: b3452a1863c36290b13e16161e2703d9a3737f0e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-06 09:40:09 +00:00
Aaron Bohy 2e6ec66022 [FIX] web: editable list: correctly edit in readonly
Some widgets allow the edition in readonly (e.g. boolean_toggle,
priority...). In this case, the changed value is saved directly.
Before this commit, this didn't work in (main) list views: the
widget was updated with the new value, but it wasn't saved in db,
so the change was lost at reload.

This was due to the list controller not being correctly aware of
its mode ('edit' or 'readonly'), on which the basic controller
relies to determine whether a change must be saved directly or
not.

With this commit, a list is always in 'readonly', except when a
row is being edited, in which case it is in 'edit'.

Issue reported on task 2288963

closes odoo/odoo#54075

X-original-commit: 64e55cb42163643386740fbd23d710f64033b2ae
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-03 16:41:56 +00:00
Pierre Paridans c9ba9dc94b [FIX] web: TempusDominus unsafe access to config
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.

This commit fixes it by first checking for config existence before
attempting to access its property.

Note: as this is a fix inside a library, a comment is added to make
clear. Also similar fixes where already done in the same file.

opw-2242880

X-original-commit: fe1f7c3e361bbd249b4025a464c546f478b6e989
2020-07-03 15:54:08 +00:00
Pierre Paridans eba83eddd4 [FIX] web: extract date picker's input setter
This commit extracts the DatePicker widget's input setter to allow
overriding it and preventing from calling the `datetimepicker` lib when
not initialized (like on mobile).

Note: this change will be used on enterprise.

opw-2242880

X-original-commit: c0413868a8728500c52b7e1dd9a0035f90b654fd
2020-07-03 15:54:08 +00:00
Julien Mougenot ff6263dd3f [FIX] web: Support widgets in search view
Since the refactor of the control panel, support of "widgets" attributes
in the search view archs has been inadvertently dropped.

Now, they are once again supported.

Task 2061795

closes odoo/odoo#54066

X-original-commit: f33b0bc7a93e60bd0ed00b40d7459225ec0b749a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2020-07-03 15:48:42 +00:00
Mathieu Duckerts-Antoine c997700181 [FIX] web: correctly reload categories
In the search panel, the categories, i.e. fields select="one",
with attributes expand="0", and enable_counters="0" (defaults) were not
correctly updated when the domain outside of the search panel was
updated. This is no longer the case.

closes odoo/odoo#54040

X-original-commit: 99e9cac63f5034c1ba2154779fe82170dd656236
Related: odoo/enterprise#11642
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-03 10:27:40 +00:00
Mathieu Duckerts-Antoine 9aa3297b9d [FIX] web: reload search panel before view model
Problem:

Go to the application apps, select accounting in the search panel,
then filter on lunch in the search bar: the category all is displayed
as selected in the search panel (accounting is no more a valid value
since expand="0") but the application lunch does not appear in the
kanban view.

Root cause:

The kanban model is reloaded with the old domain using accounting
without waiting the search panel to be reloaded but it is only known
after the search panel has been reloaded that the accounting value is no
more valid and that all should be selected instead of accounting, thus
that the domain used by the kanban model should be updated.

Solution:

The solution to the problem is simple: first reload the search panel,
then reload the view model with the updated domain.

X-original-commit: 8589babcd0f2c15433fe1eb06d0d745e80d01c22
2020-07-03 10:27:39 +00:00
Nicolas Martinelli 88c328bcd0 [FIX] web: do not suggest translation for empty HTML field
- Activate more than one language
- Install sale_quotation_builder
- Create a new quotation model without website description
- Create a SO using this model, Save

The 'Please update translations of' is displayed for the website
desctiption, although it is empty: when clicking on the link, no record
is shown.

This happens because an empty HTML field always contains at least
`<p><br></p>`.

We do not consider the latter string for translation.

opw-2274203

closes odoo/odoo#54025

X-original-commit: aad4d516b6fb4b286f24bc536e5ecb67558a0c4d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-03 07:43:03 +00:00
Aaron Bohy e17dc1a793 [IMP] web: form: labels of several occurrences of a field
Before this commit, when the same field occurred multiple times in
a form view, all occurrences were associated with the same id, and
all occurrences of the corresponding label (if any) had the same
'for' attribute. As a consequence, besides the fact that there were
warnings in the chrome console, clicking on any occurrence of the
duplicated label focuses the first occurrence of the field.

This commit generates a unique id for each pair label/field, when
possible. However, there is a case that can't be handled
automatically: when the label isn't automatically generated (field
located outside a group, or with nolabel attribute set to "1").
Typically, in this case, there is a <label> node with "for"
attribute referencing the associated field. In this situation, the
id must be defined in the arch, and used in the "for" attribute:

  <form>
    <label for="phone"/><field name="phone"/>
    <label for="phone_2"/><field name="phone" id="phone_2"/>
  </form>

Task 2261697
2020-07-02 13:57:37 +00:00
jerome hanke (jhk) f29f7c63ae [FIX] website_mass_mailing: editing the newsletter warning banner in the translation web editor
Steps to reproduce:
- install website, website_mass_mailing
- go to website, edit and add a popup window (you should see warning banner stating
that a newsletter popup is present on this window). Save.
- go to settings > languages > load a new language (fr_FR for example) and translate
the website
- go back to the website > select the new language > click the TRANSLATE button

Previous behavior:
the warning banner is not editable, also click the "Edit popup" button does nothing

Current behavior:
clicking the "Edit popup" button triggers an alert with
a quick explanatory text

opw-2280188

closes odoo/odoo#53988

X-original-commit: af57e4924dbd432f9362881dae71d2a4e4595a1f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-07-02 13:03:31 +00:00
Benjamin Vrayandqsm-odoo 58179cebf1 [IMP] web, *: replace the bootstrap backdrop element with a bg on modals
*: web_editor

Do not display the backdrop element added by bootstrap in the body and
add a background on the modal to keep the same effect. The bootstrap
backdrop was probably useful for compatibility with <IE9 but is no
longer needed. This also avoids z-index issues because modals could be
opened in an element (e.g. the website #wrapwrap) whose stacking context
is different of the body one (where the backdrop is opened). This would
make the backdrop appears on top of the modal.

Part of https://github.com/odoo/odoo/pull/49142
Related to task-2229551

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-06-30 14:19:17 +00:00
qsm-odoo 4341a4d795 [IMP] web: better test modal backdrop behaviors
Part of https://github.com/odoo/odoo/pull/49142
task-2229551
2020-06-30 14:19:17 +00:00
Benjamin Vray 79ce38fc3f [IMP] website, *: add the possibility to hide the copyright section
*: web

Part of https://github.com/odoo/odoo/pull/49142
task-2229551
2020-06-30 14:19:17 +00:00
Benjamin Vrayandqsm-odoo b43546c091 [IMP] website, *: add the possibility to hide the footer, per page
*: web

Part of https://github.com/odoo/odoo/pull/49142
task-2229551

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-06-30 14:19:16 +00:00
Benjamin Vray 904fea38a2 [IMP] website, *: add minor improvements on header / footer design
*: web

+ Ease edition

Part of https://github.com/odoo/odoo/pull/49142
task-2229551
2020-06-30 14:19:16 +00:00
Benjamin Vrayandqsm-odoo 5879e40445 [IMP] website, *: add new footer effect options
*: web

Part of https://github.com/odoo/odoo/pull/49142
task-2229551

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-06-30 14:19:16 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
Sébastien Geelen (sge) 6d93c72564 [IMP] base : improve messages text in access_error pop-ups
* Improve layout of access error messages from group restriction
 * Improve layout of access error messages from security records rules
 * Use the error title in the js crash manager when possible
 * adapt unit tests

closes odoo/odoo#50369

Taskid: 2206787
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-30 13:59:23 +00:00
Bruno Boi 647e3d34b8 [IMP] web: prevent modal titles to overflow…
…by breaking words.

closes odoo/odoo#52727

Taskid: 2253703
Related: odoo/enterprise#10947
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-30 09:35:56 +00:00
Mathieu Duckerts-Antoine 141aaa2db1 [FIX] web: renderers with a pie chart can reload
The on_attach_callback methods on the widgets (comming from a tag
'widget') of a form renderer were not called at an appropriate time.
They were not called at all or called before the widgets were actually
in the dom. This was made manifest in the dashboards that generally use
pie charts widgets. Each time a pie chart widget is renderered,
a new canvas with a unique id is created. The above mentioned problem
explains why Chart.js was not able to acquire the canvas contexts: they
are obtained by looking for a specific id in the dom.

The present commit fixes that problem by doing in the class FormRenderer
what was already done correctly in the child class DashboardRenderer and
remove the unapropriate calls to on_attach_callback in _renderWidget.

Task ID: 2278717

closes odoo/odoo#53853

X-original-commit: 7641c7074616b4375f1eb4f1fcb5a96e2ed39f94
Related: odoo/enterprise#11537
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-30 09:12:11 +00:00
Julien Mougenot c96de07f85 [FIX] web: Allow default favorite filter over search default
Before this commit, when a search_default on a many2one field tried to
update its label after a name_get, the value was set on its initial
associated query element which could have been erased by a default
favorite.

Now, the model determines whether there is a default favorite before
processing default filters, preventing any unnecessary RPC.

closes odoo/odoo#53840

X-original-commit: ff834d0ba6f9b7eadc23c28dbbf892eba2058583
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-30 07:22:12 +00:00
Xavier Dubuc 65c71a5a7a [FIX] web: fix do-action handler so it calls web_client do_action
The do-action handler added was calling directly doAction method of
action_manager which lead to an issue in enterprise as the override
taking care of closing home menu in web_enterprise/do_action was no
more called. This commit fixes that by calling the do_action method of
abstract_web_client and thus the override to be executed.

Originally detected in task-2282273

closes odoo/odoo#53836

X-original-commit: 7949baf08b7e07cb5f25f1a42b4eb12ed3a65a64
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-29 18:52:11 +00:00
Hardik PrajapatiandMohammed Shekha c3080e54ed [FIX] web: update action on archive/unarchive
Before this commit, when archiving a record through the action
menu, the 'Archive' link was not updated to 'Unarchive' and same
when unarchive was clicked, the link was not updated to 'Archive'.

After this commit, when archiving a record through the action menu,
the 'Archive' link is updated to 'Unarchive', same way when
unarchiving a record link is updated to 'Archive'.

This commit also introduces a new prop 'closeOnSelected' to the
Dropdown component, to specify whether the dropdown should be
closed when an item is selected, and makes Action Menu dropdown
closed on item selected.

task-2251739

closes odoo/odoo#53835

X-original-commit: dc5d02ade7747c74c31566c74932ef45c30e9356
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-06-29 18:51:47 +00:00
jerome hanke (jhk) 78e2d2e2fb [FIX] web: translation dialog assumes translation value for en_US
Steps to reproduce:
- Create a database with german as main language
- Load the en_US language (keep user preference as german)
- Activate debug mode > find the email template named "Purchase Order: Send PO"
- Edit the mail template > click the "DE" button to show thet translation dialog

Previous behavior:
the en_US translation is empty, it is confusing because the user assumes
that english translation have not been loaded.
that translation is actually fine when you switch to english

Current behavior:
en_US translations' empty value are assumed to be the same as the source

opw-2276673

closes odoo/odoo#53787

X-original-commit: 52975811071af3dbfe31d93b19f8a0f3a1b6b694
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-06-29 09:44:33 +00:00
Nicolas Lempereur cef65f589d [FIX] web,point_of_sale: print report preview with current company
In 13.0, the current company selected in the company switcher can be
different than self.env.user.company_id value.

Wizard "Configure Document Layout" (model base.document.layout) is using
the company in company switcher:

```
company_id = fields.Many2one(
    'res.company', default=lambda self: self.env.company, required=True)
```

But the "Preview Document" button is using user company_id, so if you
change the layout then preview, you may see the report layout of another
company which make it seemed broken.

note: also improve code of point of sale added in 59f5e57 (in case of
point of sale, company maybe should be point of sale company but you can
print several ones and the company used on point of sales is the one of
company switcher).

opw-2269849
closes #53712

closes odoo/odoo#53730

X-original-commit: bbb45e3412a5653d78aacc92903e95d1353ed60a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-06-26 11:04:05 +00:00
Nicolas Lempereur 03a0b2d22c [FIX] web: company report style on change layout
When company layout is changed, we do not update the company styles for
report: thus we still have the old style for other layout that will not
change anything (besides font).

opw-2269849
closes #53706

closes odoo/odoo#53720

X-original-commit: 8897701b1754b40d8a83c5681907c38fb205657f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-06-26 09:15:44 +00:00
Julien Mougenot a5aa6f7e51 [FIX] web: qunit detects remaining body elements
After changing the organisation of the test bundles, some elements seem
to have disappeared from most of the tests, leaving free space for other
undesirable elements to remain on the DOM after tests unnoticed.

Now, any element not allowed in the body or qunit fixture will be
properly detected and removed.

X-original-commit: 65da01e5b96ff77d25e4421d654585bc08e09d75
2020-06-26 01:28:13 +00:00
Mohammed Shekha 01a8260622 [FIX] web: drag and drop onchange fail should reload kanban
Currently, when kanban card drag and drop, it call onchange method
when onchange fails due to python error raised, e.g. UserError, kanban
view is not reloaded and kanban card stays in dropped column while
kanban card should come back to column from where it is dragged i.e.
kanban view should reload if onchange fails.

After this commit, if onchange trigerred from kanban drag and drop fails
then kanban view will get reloaded and card will come back to column
from where it is dragged.

note: in not stable version, forceFail option will not be added and
promise will fail in all cases but it is not done in stable for safety.

task-2267444

closes odoo/odoo#53695

X-original-commit: 27257d34c8b7374bfd8037de71f175f4ecb2913e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-06-25 15:46:46 +00:00
Xavier ALT 19033e804e [FIX] web: in search view, use modifiers to determine if filter is invisible
In search view, the "invisible" attribute can use complex expression,
and so we must rely on the "modifiers" attribute set by the ir.ui.view
post-processing to determine if a  filter should be invisible or not.

For example, considering the context {'hide_myfilter': False}, the
following view:

```xml
<search>
   ...
   <filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"/>
   ...
</search>
```

Will be returned as such by the server:

```xml
<search>
   ...
   <filter name="myfilter" string="My Filter" invisible="context.get('hide_myfilter')"
       modifiers="{&quot;invisible&quot;: false}"/>
   ...
</search>
```

After this commit, the filter "myfilter" will correctly be shown.

OPW-2243639

closes odoo/odoo#53690

X-original-commit: 00969326e24dadd9b3f6e026789a1e575dd1c8dc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
2020-06-25 15:01:29 +00:00
Lucas Perais (lpe) 2ecd2460b5 [FIX] web: formRenderer: apply class on form el for device size
Before this commit, the size of the form view was handled by a media query
It made testing impossible in certain case when the size determined the behavior
of the form view (the chatter)

After this commit, a class is put on the form view to better be able to test

task-2238141
PR #53136

X-original-commit: d42610297b46f4a1624df1907a9cce91de29fafa
2020-06-25 10:36:28 +00:00