Commit Graph
155149 Commits
Author SHA1 Message Date
Sébastien Geelen (sge) efd4a3f7c2 [FIX] web_editor: fix wysiwyg focus
Ensure the wysiwyg.js focus() method will actually
restore the cursor in the latest selection inside the editor.

X-original-commit: 54877ecd8bf2454a7023e74aa739921e1468dad8
Part-of: odoo/odoo#102603
2022-10-07 14:37:21 +02:00
Sébastien Geelen (sge) e483ae5fb4 [FIX] web,web_editor,mail : Fix ModelFieldSelector and DynamicPlaceholder
Add missing feature of the ModelFieldSelector popover :
* keyboard navigation
* additional debug value
* add default value page ( for dynamic placeholder)
* add validate callback

Migrate dynamic placeholder to be compatible with new OWL field.

task-2978722

X-original-commit: 929108e29168058fad5da85e0ff9c66d2c5b2525
Part-of: odoo/odoo#102603
2022-10-07 14:37:20 +02:00
Antoine Dupuis 5a09449ddc [FIX] tools: fix filename resolution in XSD imports
With PRs odoo/89145 and enterprise/26393 came new methods for
retrieving XSD files and using them for XML validation.

The new retrieval method expects modules to provide a 'prefix' that
is prepended to the XSD's filename. For example, l10n_cl_edi will
name its XSD files 'l10n_cl_edi.<filename>.xsd'.

However, this messes things up when one XSD file needs to import
another. For example, l10n_cl_edi.DTE_v10.xsd has the statement
'<xs:include schemaLocation="SiiTypes_v10.xsd"/>'

Currently, the filename resolver has no way of knowing that this
should resolve to 'l10n_cl_edi.SiiTypes_v10.xsd', not
'SiiTypes_v10.xsd'.

In addition, the new retrieval method saves the ZIP archives
received over the network under the '<filename.xsd>'. Thus
'SiiTypes_v10.xsd' might actually be a ZIP-encoded file.

So, we need to do something to fix the imports.
Here are two possible solutions:
1. We scrap this 'prefix' stuff and either save the ZIP files under
   a different name, or we just don't save them.
2. Or, we provide a mechanism for indicating a prefix to the filename
   resolver.

Personally, I don't see the point in saving the ZIP files, and this
'prefix' stuff seems pointless. So I prefer solution 1.

But, because I assume there must be a reason to all of that 'prefix'
stuff, here is an implementation of solution 2.

I'd be keen to know the reason, btw.

EDIT:
In addition to the first issue described above, we have the second
issue that some XSD files returned by the Chilean SII are encoded
using ISO-8859-1 encoding (e.g. SiiTypes_v10.xsd). If we leave them
in this encoding, then LXML isn't able to parse them when performing
imports.

closes odoo/odoo#102601

Solution: convert the files to UTF-8 before storing them.
X-original-commit: 75555df56475b457331938453657c1f73d231e33
Related: odoo/enterprise#32482
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-10-07 14:37:14 +02:00
Lucas Perais bf8aee73b3 [FIX] mrp: production form grid: closer items for quantity.
Before this commit, in the mrp_production form view, the quantity items
were spread out.

After this commit, they are closer together.

closes odoo/odoo#102582

X-original-commit: 3aa74fd15ed951974485fadd6a362fdaf374b202
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-07 14:37:09 +02:00
rhe-odoo 9e6315924e [FIX] point_of_sale: close session from pos config
There was a traceback when closing the session from the pos config.
Step to reproduce:
 1. Open a session
 2. Go to the pos config
 3. Try to close the session

 This commit allows the user to close the session from the config.

closes odoo/odoo#102581

X-original-commit: a34c9ab209c7859ed500fb44d580cc546e56bd37
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-10-07 14:37:06 +02:00
stefanorigano (SRI) c9abf79cfe [FIX] mail: followButtonView, review design
This commit force the button's width to the longest string available,
depending by the language either "Following" or "Unfollow".

It also force "Unfollow" text-color to "warning".
Indeed, since it appears on :hover only, the text color used was
ultimately the :hover(ed) version, that's substantially darker.

task-3005130

closes odoo/odoo#102528

Related: odoo/enterprise#32453
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-07 14:37:01 +02:00
stefanorigano (SRI) df6373970c [IMP] mail: topChatter, review design
task-3005130

Part-of: odoo/odoo#102528
2022-10-07 14:37:01 +02:00
stefanorigano (SRI) db86a64047 [IMP] web, sale_timesheet: review cp design
task-3005130

Part-of: odoo/odoo#102528
2022-10-07 14:37:00 +02:00
stefanorigano (SRI) 9ed4a700c1 [FIX] mail: formRenderer, chat's width should match form's sheet one
task-3005130

Part-of: odoo/odoo#102528
2022-10-07 14:37:00 +02:00
FrancoisGe 5cf5e8fdd3 [FIX] web: restore open notebook page
The purpose of this commit is to allow the restoration of open pages
in notebooks of a form view when switching view.

How to reproduce?
- Go to a form view with a notebook.
- Select a page in the notebook
- Go to another view
- Use the breadcrumb to go back to the previous form view

Before this commit:
The page opened in the notebook is the default one (the first one
or the autofocus one)

After this commit:
The page opened in the notebook is the one previously selected

closes odoo/odoo#102468

X-original-commit: 160c0347526612b6e6f93b8079eeb868d37d48f4
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-07 14:36:52 +02:00
FrancoisGe 106dc30beb [FIX] barcodes: barcode_trigger does not work in the new view
Before this commit, in new views, it is no longer possible to click
on buttons with barcode_trigger="..." using a barcode scanner.

Why:
New views no longer propagate all attributes to the button.

How to reproduce:
- Go to a form view with a button with barcode_trigger="doit"
- Scan "O-BTN.doit", "Enter".

Before this commit:
 Nothing happens.

After this commit:
    An event click is applied to the button.

closes odoo/odoo#102423

X-original-commit: b4cb2ee2662173e08f671eb736130f8332265de7
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-07 14:36:49 +02:00
fdardenne 26c550d75a [FIX] web: accentuate the carret contrast
Before, carret was not contrasted enough which made it less visible.
Now, it's more contrasted and visible.

closes odoo/odoo#102564

X-original-commit: 49ffc05da315a9060233c9960038dd0b36a54d91
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2022-10-07 13:37:19 +02:00
yhu-odoo 885fa4301c [FIX] mail: missing check of actions
Reproduce:
Click "send_reminder_preview" button on purchase form and error raise.

Missing check if actions are None or not before get its length.

closes odoo/odoo#102563

X-original-commit: 0ba99bd71d47571ac748ab0ecd68c52891cddb9f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2022-10-07 13:37:16 +02:00
Samuel Degueldre 89013fa42a [PERF] mail, web: accelerate page loading by lazy-loading emoji data
Previously, the emoji data that is used in the emoji grid was part of
the main assets bundle. This file is almost 500kB and the data it needs
is only needed when opening the emoji grid. This commit moves this file
into its own bundle and only loads it when opening the emoji grid
instead.

This PR also batches the inserts in the emoji model, bringing the time
it takes to do those inserts from ~8000ms to ~800ms.

closes odoo/odoo#102562

X-original-commit: e272e4fc6abce3153cce3748d8a5a7df63565916
Related: odoo/enterprise#32468
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-07 13:37:11 +02:00
FrancoisGe 9c8bff35be [FIX] web: throw an error when saving a record in a list view
Before this commit, in a list view, it is possible to have two records
in edit mode at the same time if an error is thrown when saving
the editedRecord.
The editedRecord is the only list record that can be in edit mode.

Why:
If a server error is returned when saving the editedRecord, then it
stays in edit mode but is no longer considered the editedRecord of the
list. It is therefore possible to switch another record to edit mode.

Solution:
The record that fails its save due to the error should stay the
editedRecord of the list.

How to reproduce:
- Go to a list view
- Edit a record
- Click on another record (the "write" operation returns an error)
- Close the error dialog
- Click again on the other record

Before this commit:
Both records are in edit mode

After this commit:
Only the edited commit is in edit mode.

closes odoo/odoo#102560

X-original-commit: 77092167cf8f8fca11a39005d720fa82abeec0ae
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-07 13:37:09 +02:00
Bruno Boi 751ed08c3b [FIX] web: nested x2many context fix
- Before this commit
Suppose that in a form view, there is an x2many list view
that would open a form view dialog when edited.
For the dialog to open, the concerned record is duplicated and
passed in props to a FormRenderer.
Now suppose that this form view dialog also has an x2many list
view rendered somewhere: the StaticList datapoint attached to
this list will have the same context as its parent.
This is not what we want because some of the keys of the context
does not make sense with the list's model.
In fact, it has led to tracebacks to be displayed in case of we want
to open a record of this list in another form view dialog.

- After this commit
When those lists are created, their context are cleared from
their parents' keys starting with "default_" or ending with "_view_ref".

closes odoo/odoo#102557

X-original-commit: 1ba468706295f651105ca3fc8aae477b4f05c28e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-07 13:37:07 +02:00
Bruno Boi 26ea19804c [FIX] web: make mobile viewswitcher look normal
# Before this commit
The viewswitcher in mobile would take the whole width of the device.

# After
Fixed

# Explanation
The dropdown menu is positioned through the usePosition hook.

For this hook to compute a position, 019bbef
ceiled all the compared values.

But it may occur cases where the comparison was missed by a pixel.

Here we relaxed those comparisons in
manner that they may sometimes be off from 1 pixel, but at least the
positionment behaviour will be better.

closes odoo/odoo#102548

X-original-commit: 4c82a2bba675c71b57001fda0c2e242ddba99997
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2022-10-07 12:41:24 +02:00
Bruno Boi 8076a16d17 [FIX] web: align searchmenus when no view switcher
# Before this commit
The searchmenus are aligned to the right when there is no view switcher.

# After this commit
They are aligned to the left

X-original-commit: 2a167da8096730c2bf4348e19649a0f957144b6d
Part-of: odoo/odoo#102548
2022-10-07 12:41:24 +02:00
Bruno Boi 3272317476 [FIX] web: properly align the cp_bottom_right
The commit e88988f mistakenly changed a scss rule
for the control panel bottom right section.

This commit reverse that.

X-original-commit: cc3bf7f736fe5778b4a93f1b439221557d2c8564
Part-of: odoo/odoo#102548
2022-10-07 12:41:24 +02:00
oco-odoo 21c8685f78 [FIX] account: reports: allow constant factors when expanding an aggregation expression
Before this fix, the expansion helper did not support formulas in the form

LINE1.label / LINE2.label * 100

because "100" couldn't be splitted between line code and expression label.

This case is now supported, as it is required for reports needing to compute percentages using other lines' values, like the executive summary.

closes odoo/odoo#102470

X-original-commit: ea2347e7ce43f8129568e6d4a8734ea8ebfc3b96
Related: odoo/enterprise#32425
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-10-07 12:41:17 +02:00
oco-odoo 7fb0b88403 [IMP] l10n_nl: Use anglo saxon accounting by default
closes odoo/odoo#102164

X-original-commit: 9ac6af71c0795bb6887a126444143e713df0c43d
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-10-07 12:41:12 +02:00
Odoo's Mergebot 14e104f29e [FW][FIX] event_*, survey: fix form views
Purpose
=======
Fix various form views broken because of the always edit mode.

Specifications
===========
website_event_questions
Avoid truncated question display by making the question
field to take all available horizontal space.

website_slides
Remove unnecessary helpers so that they don't clutter
the form view.

event_booth
Adding placeholder for booth category on event type booth form.

survey
Fixing the question type previews which have been broken due
to the new form grid layout.

Task-3004219
Parent-Task-2996467

closes odoo/odoo#102547

Forward-port-of: odoo/odoo#101959
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-07 11:13:20 +02:00
amdi-odoo 9678df1f99 [IMP] website_event_questions: Extend title size
Avoid truncated question display by making the question
field to take all available horizontal space.

Task-2996467

X-original-commit: 36d59304617991cedf6aca18a91a31b0967aebd0
Part-of: odoo/odoo#102547
2022-10-07 11:13:19 +02:00
amdi-odoo 1d43d74b6d [IMP] website_slides: Remove unnecessary helpers
Remove unnecessary helpers so that they don't clutter
the form view.

Task-2996467

X-original-commit: 5017874e3d164a6e55b75f4c8b0f1addb4320c68
Part-of: odoo/odoo#102547
2022-10-07 11:13:18 +02:00
amdi-odoo 4ccf7b4de0 [IMP] event_booth: Add placeholder
Adding placeholders for the booth category field on
event type booth form, quick create booth form
and event booth form from event for
comprehension purpose.

Task-2996467

X-original-commit: 7b56360feb35df9d68f71a5fad95a3248ea6a3eb
Part-of: odoo/odoo#102547
2022-10-07 11:13:17 +02:00
Jérémy Hennecart (jeh) 0aa300785a [FIX] website_event: fix frontend track edition
When editing a field on a track, a traceback was raised because the
fields website_menu and website_url are not present in the event.track
model.

Now we always use the event.event model and we get the event object id
from the url.
We also set the url as the current one to stay on the same page after
reloading it.

task-2942617

closes odoo/odoo#102545

X-original-commit: 5f1f082dbe268522f8fc7e63ad5f564b25020a22
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-07 11:13:14 +02:00
Jérémy Hennecart (jeh) 81f13d32cb [FIX] website_event: avoid multi tooltips on date edition
Avoid having multiple tooltips. We keep only one "t-field"
in the template. The other are replaced by a "t-out".
We also add a specific message when the datetime format is not
respected.

task-2942617

X-original-commit: a99d684507782cd0d9ff700dc7a12f7a46442403
Part-of: odoo/odoo#102545
2022-10-07 11:13:13 +02:00
Romeo Fragomeli a918e7bf37 [FIX] web: width: 100% on .o_field_widget in a group
Restore the old CSS rule:
```css
.o_form_view .o_group .o_field_widget {
    width: 100%;
}
```
Also note that since grid, ´.o_inner_group´ doesn't have the
´o_group´ class anymore.

closes odoo/odoo#102533

X-original-commit: 98dc0b9b9c17354d03714cb51fd3e310f16bef6a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-07 11:13:10 +02:00
Pierre Masereel 8eb19d12c3 [FIX] point_of_sale: payment screen style
Since new desaign made in point of sale, the payment screen has a HUGE
numpad. Payment buttons and other buttons on this screen are too small
to be easily touched on a touchscreen.

We reduce the space take, by the numpad and give more space to other
buttons to make the interface more usable.

closes odoo/odoo#102513

X-original-commit: eeb66a815310b6a7870915e53f446e6b1f0180f6
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-10-07 11:13:06 +02:00
Ahmed Khalaf (ahkh) 983020d325 [FIX] stock: replenishment info alignment issue
Before this commit, the `stock.replenishment.info` wizard form
had alignment issues, because of `group` tag, the content was aligned
to the left.

closes odoo/odoo#102505

X-original-commit: 7391961c552214e95e3613be9ab07b61ff86feac
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Ahmed Khalaf  <ahkh@odoo.com>
2022-10-07 11:13:02 +02:00
Xavier-Do cd309a200f [IMP] base: don't add bundle name in bundles
The bundle name is irrelevant in the bundle content and will prevent
attachment to store the same file if the bundles are exactly the same.

closes odoo/odoo#102502

X-original-commit: b1d57adf6ff358aa79f41817f4f7bfe60f9e5ac0
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-10-07 11:12:59 +02:00
Xavier-Do 4e9ad91107 [FIX] tests, base: gc filestore at the end of a tests
During the tests, many attachment can be created and unlink.
They will be eventually cleaned up if the cron is ran but this is
usually not the case during tests. The disk usage can increase to reach
more than one 1 Go when design theme is installed.

This can lead to unnecessary big database dumps.
This is also a problem on odoosh where the filestore max size is limited
to 1Go.

The gc should be quite fast if nothing was changed since it will just
check the content of an empty directory.

The method is made accessible in the test case in order to be able to gc
on demand. This may be useful in the test_01_crawl_every_themes that
can generate around 600~ Mo of attachment in the loop.

X-original-commit: 187309f5a39f8fef9b07959fd73475fd6732efb3
Part-of: odoo/odoo#102502
2022-10-07 11:12:59 +02:00
Lucas Perais 35e88a332a [FIX] web: phone,email,selection fields show helpers on hover
Only on devices not handling touch.

Before this commit, the phone, email, and selection fields always displayed
their field as in edit mode, even if not hovered.

eg. The envelope button of the email field, the SMS and call button of the phone field
and the caret of the selection field where always visible.

Since the form is always in edition, it doesn't make sense to always display those elements.

This commit makes those element display only on hover and on focus.

closes odoo/odoo#102489

X-original-commit: f87aa36f42fc190285241aeb8e1a4d9ab1644989
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-10-07 11:12:56 +02:00
Romeo Fragomeli 9f0bdc121d [FIX] project: recurrent task layout
The main goal of this commit, is to add missing `colspan="2"`.
We also hide the div and its label at the same time.

Steps to reproduce:
* Open Project
* Select a project
* Select a task
* Click on Recurrent checkbox (if not checked)
* Select the Recurrent Notebook => BUG

closes odoo/odoo#102444

X-original-commit: 398d5bc03adf040968494b526ba1f34b8e2cc227
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-10-07 10:07:38 +02:00
nda-odoo 9f37a9d93d [FIX] base: make extract_rfc2822_addresses more robust
If source is something like
"admin@éxample.com" <admin@éxample.com>

candidates founds are
['"admin@\xc3\xa9xample.com"', 'admin@\xc3\xa9xample.com']

and the first one raises an error because of "".

Malformed addresses should be ignored.

opw-2982426

closes odoo/odoo#102353

X-original-commit: 35ad2dd630a8ed173c6a9275585eac46b9a19363
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-10-07 10:07:35 +02:00
Joseph Caburnay 1d5c9848f2 [FIX] web: keyboard navigation on list
This is a followup to: https://github.com/odoo/odoo/pull/102268

When navigating around the view with keyboard arrows:

**Before this commit:**

- there is blue outline on focused cell
- focused row is not highlighted
- https://youtu.be/kD72hic7dME

**After this commit:**

- row is highlighted when hovering or focusing
- no more blue outline on focused cell
- https://youtu.be/qqSqOVaqbEA

closes odoo/odoo#102512

X-original-commit: ded2cf44a7b6d6b79dbe8317be2018da922e0cfd
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-10-07 09:10:15 +02:00
Kevin Baptiste eb514d364c [FIX] fleet,hr_(recruitment|attendance): fix post-always edit
This PR adapts the form views since the merge of odoo/odoo#100570.

task-3002465

closes odoo/odoo#102488

X-original-commit: 56b877c2cbeeaf3bd6e42645db691467a1ba4ff4
Related: odoo/enterprise#32431
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-07 09:10:08 +02:00
Soukéina Bojabza a1c20d2a75 [IMP] web_editor, website: keep the grid items at the same z-index
In [1], the resizing and the drag and drop of a grid item both put
it in front of all the other items and in front of the background grid
(thanks to the `z-index` property).

This commit changes that behavior: now, the grid item stays at the same
z-index if we are resizing it or if we are dragging it over the grid
from which it is coming. In the case of a drag over an other grid, it
is placed in front of all its grid items. In all these cases, the grid
item is placed behind the background grid.

[1]: https://github.com/odoo/odoo/pull/93144

task-2973198

closes odoo/odoo#102525

X-original-commit: 67d1b078329600efce414974307d74e9fa9ba9fe
Related: odoo/design-themes#601
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-06 23:14:42 +02:00
Soukéina Bojabza ae8a5dc330 [IMP] web_editor: remove the temporary fix for the history of the grids
Since the merge of [1], the undo/redo of a resizing is made in one go
and not in multiple steps. The row count of the grids are therefore
correctly updated at each undo/redo operation.

This commit removes the temporary fix made in [2] to always have the
correct row count when undoing/redoing, as it is not necessary anymore.

[1]: https://github.com/odoo/odoo/commit/423f4bd2a6cc47e69699d2437eaa5acda94bb98d
[2]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec

task-2973198

X-original-commit: 43d2e588c93b3dc5750eae564c7296159f40c413
Part-of: odoo/odoo#102525
2022-10-06 23:14:42 +02:00
Soukéina Bojabza c677040ded [IMP] web_editor: manage better the content bigger than one grid cell
In grid mode, when a grid item width is one (grid) column, if its
content is bigger than a column size, it makes the column
grow with it while the other ones are shrinking.

This issue was solved in [1] by using the `word-break` property but it
is not the best solution. This commit fixes the issue by setting the
`min-width` property to 0 instead.

[1]: https://github.com/odoo/odoo/pull/93144

task-2973198

X-original-commit: 5d37ada861bf5de348de54d5d7de0d06e14ed28e
Part-of: odoo/odoo#102525
2022-10-06 23:14:42 +02:00
Soukéina Bojabza 067fce44ef [IMP] web_editor: remove footer scroll effect during drag and drop
When the footer has the "Slide Hover" and the "Shadow" scroll effects,
and if it is in grid mode, the grid dropzone flickers a lot when we
drag a column over it. This happens because the scrolls caused by the
dragging, the growth of the grid and the scroll effect all happens at
the same time.

This commit removes temporarily the scroll effect of the footer during
the drag and drop to avoid this situation. It also has the advantage of
displaying the footer entirely, making it easier to see where we are
placing the elements.

task-2973198

X-original-commit: bbde919634aeaffcf421283445e25181a522f287
Part-of: odoo/odoo#102525
2022-10-06 23:14:42 +02:00
Soukéina Bojabza 3749d6d66c [FIX] web_editor: add support for unordered dropzone events
When going from a dropzone to an other, and if it is done really fast
or if the dropzones are really close (glued to each other) or if they
are overlapping, the order of the "over" and "out" dropzone events is
not the one expected.
Indeed, instead of having over > out > over, we have over > over > out.
This resulted in a traceback when using the grid as the listeners and
properties were therefore not removed correctly when such a case
happened.

This commit adds the support for this situation by first detecting if
two "over" are following each other and then making a virtual "out" if
this is the case.

task-2973198

X-original-commit: c6886410603a16b6a3c5fe459d273dd883c110c7
Part-of: odoo/odoo#102525
2022-10-06 23:14:41 +02:00
Soukéina Bojabza 5a93e4fe0b [FIX] web_editor: solve bug when removing all columns of the footer
When removing all the columns of a block with no parent, like the
footer, a traceback was appearing because updateUIVisibility was trying
to access the properties of an inexisting parent. This commit
fixes that by first checking if the parent exists.

task-2973198

X-original-commit: 3e7ad08581295af6a986ba2b81ec25d9cd78e91d
Part-of: odoo/odoo#102525
2022-10-06 23:14:41 +02:00
Soukéina Bojabza fcca35ff63 [IMP] website: make the Masonry snippet grid-only
This commit modifies the Masonry snippet, along with all its templates,
in order to always be in grid mode.

A change worth noting is that the images are now real images and not a
background and text can be added over them with the "Add Elements"
option. This change happened mainly for the look of the mobile view but
also because it is more logical since the snippet is supposed to
contain "images" and "text".

The themes extending Masonry have also been adapted in [1].

[1]: https://github.com/odoo/design-themes/pull/592

task-2973198

X-original-commit: 85b352af319edec84407f2046cf795b4e5503460
Part-of: odoo/odoo#102525
2022-10-06 23:14:41 +02:00
Soukéina Bojabza f9e00bf2ba [IMP] web_editor: limit the number of rows added in a grid on drag
When dragging a grid item downwards in a grid, an infinite number of
rows can be added. This is unconvenient because it is difficult to
escape a grid if the snippet is "container-fluid" for example.

This commit limits the number of rows that can be added at once when
dragging downwards. The limit is fixed to 10 rows. Of course, it is not
a total limit, this means that after dropping, if the grid item is
dragged again, 10 additional rows can be added.

task-2973198

X-original-commit: 888f522aa812136f10af1c5fad8f17eea0c3b5b6
Part-of: odoo/odoo#102525
2022-10-06 23:14:41 +02:00
Soukéina Bojabza f926559823 [FIX] web_editor: solve the history bug when dropping out of a dropzone
When dragging a grid item and dropping it outside (near) a dropzone,
and then undoing the operation, the grid item didn't return to its
original state: some removed classes and style properties were not
added back. This would cause the item to be broken and trying to drag
it had unexpected results that could even lead to a traceback.

This behavior was caused by the fact that the grid item was not
attached to any element when these attributes were modified, so the
changes happened "nowhere". This commit fixes that.

task-2973198

X-original-commit: 83c07fcce898225f06f1ba84059a031409db0627
Part-of: odoo/odoo#102525
2022-10-06 23:14:40 +02:00
Soukéina Bojabza 318c937d9d [IMP] web_editor, website: allow/forbid grid mode for each snippet
Currently, the toggle to grid mode is not the same process for all
snippets: some have both the option 'Layout Grid/Cols' and the ability
to toggle on drag but other don't have the option, making it
complicated/impossible to leave the grid mode. Also, the snippets for
which the grid mode has been blocked don't have their move handle
anymore, which prevents them to use the normal drag and drop (it was
hidden because dragging them would toggle the grid mode).

This commit uniformizes the grid mode for all snippets and adds the
move handle back to the ones that cannot use this mode. It also
improves the grid mode of the 'Items' and 'Carousel' snippets.
More precisely:

- All the snippets that are allowed to have the grid mode now have both
the option "Layout Grid/Cols" and the ability to toggle on drag.

- The snippets who cannot toggle the grid mode have the move handle
back but it doesn't toggle on drag and they don't have the option. They
use the "normal" drag and drop.

- The drag and drop has been improved to allow normal columns to go
inside the grids. Indeed, since the drag was previously blocked, this
case could not occur but now that it is possible, it had to be taken
into account.

- The grid mode of the Items snippet has been improved by removing the
"hardcoded" height that was breaking the grid.

- The vertical dropzones of Carousel appearing when dragging inner
content have been removed because they appeared in grid mode and were
breaking it. It is also more logical because now that this snippet has
a column option, vertical dropzones should only appear when dragging a
column.

task-2973198

X-original-commit: 84d684d8bdf43d3db11defd8174dee44775085c2
Part-of: odoo/odoo#102525
2022-10-06 23:14:40 +02:00
Soukéina Bojabza 82172c900a [IMP] web_editor: allow elements outside of the row to be in the grid
The 'Picture', 'References' and 'Pricelist' snippets have some of their
content placed outside the row element, causing them to not be in the
grid when activating the grid mode, which is unconvenient.

This commit allows these contents to be placed in the grid when the
grid mode is toggled, by creating a column and putting them in it.

task-2973198

X-original-commit: 6f3041f9015c50b4986b3c26aad86da4a0a04d50
Part-of: odoo/odoo#102525
2022-10-06 23:14:40 +02:00
Soukéina Bojabza 1dff079f09 [IMP] web_editor, *: improve toggle and d&d in grid mode for the images
*: website

In grid mode, the images take the whole space in their column so they
always have the same size as them. However, if text was added in the
column (before or after toggle), it always looked like it was
overflowing and the overlay would not cover it even after resizing.

Also, since these images have the value of the `object-fit` property
set to `cover`, the images are cut if they are too big for the column.
This is problematic if the image has a shape because the shape is cut
too, ruining the visual effect.

This commit solves these issues by distinguishing the images that are
alone in their column from those that are not. An image is considered
alone if it is a direct child of the column and if there is no text in
it (the line breaks and empty lines are excluded). Now, only this kind
of images, if they have no shape, take the whole space in the column
and have `object-fit` set to `cover`; the other ones behave like the
columns in normal mode.

This distinction also allows to block the edition of the columns
containing only an image. Indeed, adding text or dropping inner content
in them had the same overflowing effect.

task-2973198

X-original-commit: e9c7e020daf88022d6e02de0a5620074e8417b5a
Part-of: odoo/odoo#102525
2022-10-06 23:14:40 +02:00
Soukéina Bojabza 339f9636eb [IMP] web_editor, website: make Big Boxes snippet able to use grid mode
The grid mode allows some snippets to move and resize their columns in
a grid. However, some of them were blocked because they don't look good
in this mode. This is the case of the Big Boxes snippet: because it
contains two blocks full of padding and since toggling the grid mode
removes this padding, it ended looking weird.

This commit allows the previously blocked Big Boxes snippet to toggle
the grid mode. More generally, this commit allows snippets having only
columns containing a background color to look good in grid mode by
keeping a more logical padding for them.

task-2973198

X-original-commit: a051922f8359178f4abe578ce9555d34cbb02613
Part-of: odoo/odoo#102525
2022-10-06 23:14:39 +02:00