Commit Graph
1435 Commits
Author SHA1 Message Date
qsm-odoo c12b472dba [FIX] website, *: review navbar color system
* web_editor, website_slides

Current system is styling all navbars with the user color. This was not
the expected behavior but it is in fact quite nice, so we decided to
keep it. There was however a problem: choosing the menu text color only
applied to the main navbar (as it was an xpath toggling the navbar-dark
class).

This commit solves the problem by forcing navbar-light to behave as
navbar-dark automatically if the menu background is dark, and this
without any JS or extra CSS rules. This allows to get rid of the menu
text color option.

This commit also reviews the light and dark colors which are used when
website is not installed.
2018-09-19 14:09:12 +02:00
Aaron Bohy 66c716d781 [FIX] *: adapt calls to _is_superuser
Rev. 2f7c03d added a second admin user (id 2), the 'human' one, on
top of the 'technical' one (id 1, also known as the superuser).
Basically, all calls to _is_superuser() should have been changed to
_is_admin(). They weren't. As a consequence, some features that
were previously available for the admin weren't anymore (e.g.
tours).

This rev. replaces all calls to _is_superuser() by calls to
_is_admin().
2018-09-18 20:31:28 +02:00
Odoo Translation Bot 53908da50c [I18N] Update translation terms from Transifex 2018-09-18 18:08:33 +02:00
Martin trigaux 710f67ad4b [I18N] export saas-11.5 source terms
To match new model_terms syntax
2018-09-18 14:30:04 +02:00
Pierre Masereel 7288b4779a [IMP] base, tools, web_edeitor: improve ir_translation insertion
The ir_translations were pretty slow to load, this was mainly caused by
the condition in variable 'find_expr' and the import of po values in the
temporary table.

To improve the load performance, we made two improvement:

1. Insert the row in the temporary table by batch instead of making an
   insertion for each record.
2. Replacing the condition in the variable 'find_expr' by partial unique
   index. To perform such a thing, we had to separate the type model in
   two types, 'model' and 'model_terms' because it wasn't possible to
   create a partial unique index on type 'model' because the type was
   used for two different use cases. The type model is now used for
   fields that have have a value not callable for the attribute
   translate, these field can only have one record for the same field,
   model, res_id and language. And the type 'model_terms' is used for
   the fields callable, because they can have multiple sources for the
   same res_id.

We also removed the deprecated types 'report', 'help', 'view', 'field'.

Thanks to @rco-odoo for the improvement of the first point.
2018-09-18 14:30:03 +02:00
Odoo Translation Bot e9111f46a6 [I18N] Update translation terms from Transifex 2018-09-16 02:21:25 +02:00
Odoo Translation Bot 0b2349ee41 [I18N] Update translation terms from Transifex 2018-09-14 11:30:58 +02:00
Jeremy Kersten 57decbbed6 [FIX] web_editor: fix and improve AltDialog
Ref label
Add tooltip
Fix title from modal -> before this commit, modal title was wrongly replaced by title of image :/

task-1878245
2018-09-13 08:17:09 +02:00
Romain Derie 4fb73a3de0 [FIX] web_editor: BS4 input group button height glitch
As an `form-group` can contains element having `form-control` class and other
not having it, we should not force height on `form-group` elements.

Typically, we could have:
div.form-group
  input.form-control
  button

Forcing height only on `form-control` will make the input thinner than the
button.
2018-09-12 11:30:16 +02:00
qsm-odoo 1b4f317a08 [FIX] web_editor: BS4, do not suggest XS size for buttons
The XS size for buttons was removed in BS4. We lowered the size for
btn-sm though, so those are the replacement.

task-1878245
2018-09-12 10:56:55 +02:00
qsm-odoo f1ccc4978b [FIX] web_editor: do not ask for link style during menu item edition
The menu item dialog is an extension of the link dialog where all the
.form-group elements which contain a .link-style option element are
removed. A new link style option was recently added but with the wrong
class, preventing it to be removed for the menu item dialog.

task-1878245
2018-09-12 10:56:54 +02:00
qsm-odoo 39a441e902 [FIX] web_editor: restore link dialog preview
By default, all btn colors are suggested in the link dialog (alpha,
beta, gamma, delta, epsilon, link, primary, secondary, success, info,
warning and danger). In lots of themes (and the default one), primary
= alpha and secondary = beta, which led to having two suggestion with
the same apparent color.

A new system was introduced to automatically remove the duplicates...
but this system also removed the button preview as it considered it to
be a duplicate.

This commit also adapts the preview to BS4.

task-1878245
2018-09-12 10:56:46 +02:00
qsm-odoo c04d3d1460 [FIX] portal, web, web_editor: frontend font-size
Commit https://github.com/odoo/odoo/commit/903ff171acbef7f9fe6e533f43b99eba801b200f
lowered the font-size to 14px for the frontend by customizing the
bootstrap variable in the portal app. It changed the web_editor
rte_inline tour accordingly.

This however broke the test on runbot "base" database, as the font-size
in the editor without having installed the portal app was still set to
16px. Commit https://github.com/odoo/odoo/commit/e3bc059c3649a05c12cd3c8099092282c10141b7
only moved the failed test from "base" to "all" database.

This commit unifies the font-size for all frontends by setting it in the
web app. So, after this commit: reports, editor, login screen and
frontend will always have a font-size of 14px no matter the application
which is installed (except themes).
2018-09-11 10:58:17 +02:00
Christophe Monniez e3bc059c36 [FIX] web_editor: adapt tour to BS4 2018-09-11 10:00:42 +02:00
qsm-odoo 903ff171ac [REF] portal, website: BS4, lower <body/> font size
With BS4, the website's font size was set to 16px instead of 14px as
before. We finally decided to force the 14px back. This commit also
moves some bootstrap variables extensions to portal as it should have
been done and reformat the files to match the bootstrap _variables.scss
file.
2018-09-10 17:54:42 +02:00
Odoo Translation Bot 956720ed7f [I18N] Update translation terms from Transifex 2018-09-09 02:25:15 +02:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
Christophe Simonis 49c3264ce0 [MERGE] forward port branch saas-11.3 up to 4850fb0838 2018-09-07 14:43:48 +02:00
qsm-odoo 3444e0a0da [FIX] web_editor, *: use explicit string keys for color maps
* website

```
$map: (
    test: 1,
    black: 2,
);
@​debug map-get($map, 'test');
@​debug map-get($map, test);
@​debug map-get($map, 'black');
@​debug map-get($map, black);
```

The above code leads to a:
1
1
null
2

This is because maps' keys can be *anything* in sass (even other maps).
In the example, the map is defined with unquoted `test` and `black` as
keys which are understood as the string 'test' and the *color* black.
When asking for the value for the 'black' string key... there isn't any.

This commit forces the use of quoted string as color maps' keys.
2018-09-07 13:57:14 +02:00
Christophe Simonis f19e6ce561 [MERGE] forward port branch 11.0 up to 213759b03e 2018-09-05 18:52:27 +02:00
qsm-odoo a997a5a1c6 [FIX] web_editor: adapt 'small' colorpicker button UI 2018-09-05 14:25:53 +02:00
Odoo Translation Bot 55a5aca6d9 [I18N] Update translation terms from Transifex 2018-09-05 11:24:24 +02:00
Nicolas Martinelli 88a5d9a000 [FIX] web_editor: image name
Add the image name when the image is uploaded.

Complement of commits 886c07dabb and 152e3f8686

opw-1880472
2018-09-05 09:10:37 +02:00
Christophe Simonis 2a13863f43 [MERGE] forward port branch saas-15 up to 653bbbc733 2018-09-04 17:02:36 +02:00
Christophe Simonis 653bbbc733 [MERGE] forward port branch saas-14 up to 14f8ef59b8 2018-09-04 16:48:31 +02:00
Christophe Simonis 14f8ef59b8 [MERGE] forward port branch 10.0 up to 0f0e43ae55 2018-09-04 16:11:09 +02:00
Christophe Simonis 0f0e43ae55 [MERGE] forward port branch 9.0 up to 61b771256c 2018-09-04 15:23:54 +02:00
qsm-odoo 5ec04489f0 [FIX] web_editor: avoid odoo UI buttons override by themes 2018-09-03 18:40:35 +02:00
qsm-odoo cde3c9261e [FIX] website: review website customize dialog
Make some changes which are needed for theme migration.

- Theme colors as user colors fallback only (not hard choice)
- Review option dependency system
2018-09-03 18:40:35 +02:00
Nicolas Lempereur 7a453b0b7a [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

In 10.0 this was not necessary since the default values were sanely set
when the editor was inside the DOM. In 11.0 the editor is not in the DOM
when this is being done and the info was wrong (eg. NaN for text size).

With this commit, we don't steal the focus and get the default like it
was done in 10.0 instead.

fixes #26366
opw-1874880
closes #26582
2018-09-03 16:51:20 +02:00
Nicolas Lempereur 61b771256c [FIX] web_editor: back to first -> history stay ok
If we do:

- one change that will be saved in history
- go back to the document before any change
- do other change

we can easily get in a state were the history is no longer recorded.

The history is kept like this:

- pos: our position in the history
- aUndo: the snapshots of history
- toSnap: the last history snapshop that is to be saved

so for example if we start without change (at originalState):

  {pos: 0, aUndo=[], toSnap=null}

Then we do two changes (change1, change2):

  {pos: 2, aUndo=[originalState, change1], toSnap=change2}

If we make an undo, we will get to:

  {pos: 1, aUndo=[originalState,change1,change2], toSnap=null)

If we make another change (change3):

  {pos: 2, aUndo=[originalState, change1], toSnap=change3}

So the history after the position is removed.

But when we get back to the original, the state would forever be:

  {pos: 0, aUndo=[originalState], toSnap=change85}

because when doing a change, the code only removed history from the
max(pos, 1) index.

opw-1870119
closes #26701
2018-09-03 16:30:03 +02:00
Nicolas Lempereur 793988c7ed [FIX] web_editor: normal up/down in content in cell
In the editor in a table cell, when we press UP/DOWN keys:

- we have default editor/browser behavior if there is content before
  (UP) or after (DOWN) the element we are currently on
- else we go to the previous (UP) or next (DOWN) row if available
- else we go to the next content if available
- else we have the default editor/browser behavior

But when checking if there is an element before/after the content, we
did not take into account if there was an ancestor node inside the cell
that had content after, so for example with this structure:

```
<table>
<tr><td>
  <p>hello <b>world</b></p>
  <p>cruel</p>
</td></tr>
<tr><td>
  <p>bingo</p>
</td></tr>
</table>
```

if the current range was on 'world' text node, we would just check if
there is content after this text node, not if there is content after its
`<p/>` ancestor.

Before the fix we would get on the next row, after we would have default
editor/browser behavior: ie. if cruel is on another line, going to this
line.

opw-1870119
closes #26701
2018-09-03 16:30:03 +02:00
Odoo Translation Bot d40145a42e [I18N] Update translation terms from Transifex 2018-09-02 04:09:57 +02:00
Odoo Translation Bot e8606ce00b [I18N] Update translation terms from Transifex 2018-09-02 02:24:05 +02:00
Odoo Translation Bot 8846a0c21b [I18N] Update translation terms from Transifex 2018-09-02 00:29:56 +02:00
Odoo Translation Bot b5471da2e0 [I18N] Update translation terms from Transifex 2018-09-01 02:38:40 +02:00
Romain Derie 6bfb0810b0 [FIX] web_editor, website(_*): fix bs4
[FIX] web_editor: adapt col size to avoid too small select

We should avoid col-md-3 in col-md-9 as the menu dialog is instanciated at 2
places:
  - When creating a link in the editor
  - When editing website navbar menu

In the second case, there is a hack in `content.js` to remove `modal-lg`
lowering the width of the modal and making the select too small.

[FIX] website: lower navbar font size

With BS4, font-size of navbar element went from 13px to ~17px (rem unit
computation).

14px seems better than previous 13px as the frontend content size is
higher than the backend one. Thus, 13px looks too small in contrast with the
frontend page content.

[FIX] website_crm_partner_assign, website_customer, website_membership: fix layout

This commit fixes multiple layout issues, mainly by aligning code of the 3
modules:
  - Add margin right to avoid text to be against image
  - Using image_medium everywhere
  - Fixing search input width

publish toggle red + odoo primary is weird -> gray
navbar now has a background & float-right not working since flex
-> remove navbar class, use d-flex and ml-auto so the right element will be floating since using all available width

task-1878150
2018-08-31 16:37:45 +02:00
Romain Derie 47b00c5d53 [FIX] base,website,web_editor: handle key field on ir.ui.view for multi website
With multi-websites, we expect qweb views to have a key set as it is the key
that is used to find duplicates (two views with same keys are duplicate, the
one with a website_id set is more specific than the one without a website_id)

Thus, 5ff87e8039 sort on key in order to find the most suitable one.

It would crash if a qweb view is created without a key (False) as it can't sort
`bool` and `str`.

This commit:
  - Adds a generated key to scss views
  - Adds an SQL constraint to avoid QWeb views without a `key`
  - Generates a random key when creating a QWeb view without a `key`
  - Handle False key in `filter_duplicate()` by extracting views with False key
    before sorting, and then adding these views to the recordset

Note: We also want the key to be editable as it is now an important field with
      multiwebsite. Thus, we removed the readonly on this field.

+ fix python tests as we now force key on qweb views with sql constraint
+ pep8
2018-08-31 16:37:45 +02:00
qsm-odoo 77402a4efc [REF] web_editor, *: review color theming system
* web, website

- Introduce gray color palettes (needed for themes migration)

- Synchronize BS4 color maps with individual variables (see comments
 about this in the code).

- Review alpha/primary, beta/secondary matching:

Before this commit, we decided that the common way to define a color
palette was defining primary, secondary, gamma, delta and epsilon.
alpha and beta were then forced to primary and secondary without other
possibility.
The new system makes more sense:
1) define alpha, beta, gamma, delta and epsilon
2) primary and secondary will automatically be set to your alpha and
  beta (allowing to style the default UI with BS4-independant
  variables)
3) if you are not happy with (2), you can define primary / secondary
  in your color palette so that they are not automatically set to
  alpha / beta

This commit also changes what classes the editor uses. Background colors
and text colors will now use alpha/beta/gamma/delta/epsilon (not primary
and secondary anymore). For buttons, all the possibilities are suggested
but color duplicates are hidden (so if your primary and alpha are equal,
only one button color is suggested).
2018-08-30 11:10:56 +02:00
Odoo Translation Bot f22e61dc74 [I18N] Update translation terms from Transifex 2018-08-29 14:19:27 +02:00
Odoo Translation Bot 7526b64e8a [I18N] Update translation terms from Transifex 2018-08-26 04:10:40 +02:00
Odoo Translation Bot 0da9da4c44 [I18N] Update translation terms from Transifex 2018-08-26 02:17:37 +02:00
Odoo Translation Bot 42e41b191c [I18N] Update translation terms from Transifex 2018-08-26 00:27:45 +02:00
Odoo Translation Bot b8c6c24bbb [I18N] Update translation terms from Transifex 2018-08-24 15:54:45 +02:00
Odoo Translation Bot 10c9f07286 [I18N] Update translation terms from Transifex 2018-08-24 15:22:47 +02:00
Martin Trigaux a183a5125a [I18N] export saas-11.5 source terms
Create the odoo-12 project
2018-08-24 14:34:57 +02:00
qsm-odoo 514722d783 [FIX] web_editor: properly drop a snippet on a 2 zones-location
Sometimes, two dropzones end up at the exact same location (if two
oe_structure are somewhat siblings for example). Before this commit, in
this context, if the user hovered that location with a snippet, then stopped
hovering that location, here is what occured:
- the snippet preview is dropped after the zone 1 and the zone 1 is hidden
- the snippet preview is dropped after the zone 2 and the zone 2 is hidden
- the snippet preview is removed and the zone 2 is shown again
- ... the zone 1 is forever hidden

After this commit, the snippet preview can only be dropped once.
2018-08-22 16:11:48 +02:00
qsm-odoo c35cc4296a [REF] web_editor: review some dropzone code
- Remove useless code
- Make searching for the nearest dropzone more efficient
2018-08-22 16:11:48 +02:00
qsm-odoo 559ce05186 [FIX] web_editor: restore vertical dropzones
Dropzones between columns were displayed vertically, they were detected
thanks to their 'float' property. With BS4, columns are not floating
elements anymore, they use flex. So the code had to be adapted.
2018-08-22 16:11:48 +02:00
Jeremy Kersten 2431e2a9ea [FIX] web_editor, website: remove useless code / comment
Rebase failed, these lines should be no more there.
2018-08-22 10:08:30 +02:00