Commit Graph
152937 Commits
Author SHA1 Message Date
xO-Tx 8a3c882de8 [FIX] website: adapt new page dialog UI
The goal of this commit is to fix "New Page Dialog" margin issue
related to the use of '.form-group' CSS (dropped on BS5) and replace
it with a simple row gutter.

closes odoo/odoo#97919

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-11 17:56:54 +02:00
Louis Wicket (wil) 52e6e0ce54 [IMP] mail, *: move channel_type field from Thread to Channel
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.

* = im_livechat, test_discuss_full

Part of task-2948676.

closes odoo/odoo#97779

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-11 17:56:51 +02:00
William Henrotin 360924b4b7 [FIX] mrp: do not compute unit_factor at mrp install
Installing mrp on a large database will take lots of time computing the
unit_factor of stock_moves created in stock. As this value is only
needed in mrp, this commit bypass the computation for moves that have
been generated before the mrp installation

closes odoo/odoo#97750

Task: 2918852
X-original-commit: a2f064446b1e232efc3e6924879f63b79e0bc986
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-08-11 17:56:48 +02:00
FrancoisGe 87ee170473 [FIX] web: toggle a bool in a x2m with the view in edition
Before this commit, in a form view in edition, if you clicked a toggle
boolean in an X2many, the view was saved. A toggle boolean should not do
a save if the main view is in edit mode.

The solution is to save the record only if the view's root datapoint
is in edition.

How to reproduce:
- Go to a form view in edit mode with an X2many that contains a toggle
   boolean field.
- Click on the toggle boolean in the x2many

Result before:
    The view is saved.

Result after:
    The view is not saved and is still in edit mode.

closes odoo/odoo#97673

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-11 17:56:44 +02:00
Rémy Voet (ryv) f80d8e00e4 [IMP] *: optimize redundant calls to exists()
Making a `exists()` on a record got by a `search()` is useless and
lead to a extra useless query. Remove them.

closes odoo/odoo#97482

Related: odoo/enterprise#30133
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-11 17:56:38 +02:00
Julien Castiaux 4ec4ca4a83 [IMP] base: cover filestore gc with tests
closes odoo/odoo#96242

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-08-11 17:56:31 +02:00
Odoo's Mergebot ea85539c9b [IMP] mass_mailing,mass_mailing_themes: snippets adjustments
In order for all snippets to be better supported by the builder and its new design-tab, some changes were needed.
A lot of snippets used bootstrap classes (ex: for text alignment), these have been replaced by inline styles so they can be overridden by the editor.
The templates have also been adapted so as to use the newest versions of these snippets.

task-2835454

closes odoo/odoo#95940

Related: odoo/upgrade#3762
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-11 17:56:28 +02:00
David Monjoie 1898b2dba1 [FIX] mass_mailing: remove noupdate on mass_mailing attachments
Part-of: odoo/odoo#95940
2022-08-11 17:56:27 +02:00
Elisabeth Dickinson 4b5ac5d21e [IMP] mass_mailing_themes: update template thumbnails
Part-of: odoo/odoo#95940
2022-08-11 17:56:27 +02:00
Elisabeth Dickinson 4bd33d9abd [IMP] mass_mailing_themes: fix footers according to snippets
Part-of: odoo/odoo#95940
2022-08-11 17:56:27 +02:00
Elisabeth Dickinson 1aa9961996 [IMP] mass_mailing_themes: correct headers' logo area
There was a mistake on the sizing of the columns. To make room for more
social icons, the logo's column is reduced while the social
column is enlarged.

Part-of: odoo/odoo#95940
2022-08-11 17:56:27 +02:00
Elisabeth Dickinson d6eb4e3a68 [IMP][REM] mass_mailing_themes: rename images and remove unused images
In the previous version of the mail builder, the snippets had different
styles and images according to the selected template.
Now the snippets just use the default image so there's no need for
duplicates in the templates' folders.

The snippet `two_cols` no longer exists since the new version of the
mail builder, its images have been removed.

The header snippet uses the user's company logo, not the template's
default logo. If no logo image is used in the template,
there is no need for it in the folder.

The remaining images have been renamed for more consistency, except for
logo images that are .png format; these must have custom names (not
starting with `s_default_image_xxx`, as this forces .jpg).

Part-of: odoo/odoo#95940
2022-08-11 17:56:26 +02:00
Elisabeth Dickinson b218de746f [IMP] mass_mailing_themes: replace all px-3 classes with inline style
Part-of: odoo/odoo#95940
2022-08-11 17:56:26 +02:00
Elisabeth Dickinson 48d17c3ac8 [IMP] mass_mailing_themes: adapt templates after snippet adjustments
Part-of: odoo/odoo#95940
2022-08-11 17:56:26 +02:00
Elisabeth Dickinson 715e73b01e [IMP] mass_mailing: add padding-x option to snippets
An extra option is added in order to have control over the paddings.
Snippets using the `px-3` class have had it replaced with inline styles
and now have the padding option in the builder.

This was initially done for the media_list snippet, but it seems it's
useful for many more snippets.

Part-of: odoo/odoo#95940
2022-08-11 17:56:26 +02:00
Elisabeth Dickinson fcbcd9f2b7 [FIX] mass_mailing: properly allow global customize separator styles
This is an addition to commit 098202ba584ca6ba3544ccd00397578f5deb12ad
The design tab allows the customization of the separators' border-style
and width as well as color, but this is currently broken because it gets
overridden by the default styles of the snippet, which has higher
specificity.

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson a559fe4aae [MOV] mass_mailing: rename, move and remove images
Old thumbnails for deprecated snippets have been removed. The
other snippet thumbnails have been grouped together in same folder.

Some images are unnecessary since the new mail builder, some are simply
not used anywhere.
The references snippet is limited to four images, adding more columns
will copy the last column's image, so no need for images 5 and 6.

The basic template doesn't allow snippets - the editor doesn't even
appear - since no snippets can be added, their images are unnecessary in
the templates image folder.
In all cases, the drag&dropped snippets, even from other templates,
use the theme_default images and not the templates' images.

Move all images in snippets_demo folder to theme_default folder

For more consistency, default images have been renamed according to
their snippet names

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson 73160feed7 [IMP] mass_mailing: revamp of the event snippet
This snippet is now similar to the one being used in the web editor.
What was once a single event on three columns is now two events on
two columns.
The snippet's thumbnail has been redesigned to correspond to the
snippet's new design.

Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson 2815fe0807 [IMP] mass_mailing: remove data-snippet attribute on snippets
We shouldn't add a data-snippet in the declaration of a snippet,
as they are meant to be drag & dropped, the editor/right panel is going
to add that for you. We generally add them when we copy paste a snippet
definition into another view directly in our sources (ie: template)

Ref: https://github.com/odoo/odoo/pull/87059#discussion_r866903584
Part-of: odoo/odoo#95940
2022-08-11 17:56:25 +02:00
Elisabeth Dickinson d5c7f2b208 [IMP] mass_mailing: title snippet improved
Bootstrap text align class is replaced with inline style

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson 128e3baca8 [IMP] mass_mailing: text_highlight snippet improved
Replace bootstrap class for text alignment with inline styles
Remove Horizontal alignment on whole snippet to allow individual 
alignment on <h3> and <p> elements.

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson 14ee23fa0a [IMP] mass_mailing: text_block snippet improved
Remove unnecessary classes

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson bffada1463 [IMP] mass_mailing: showcase snippet revamped
There used to be a middle column to allow for a border between
the two columns, but this was selectable (not editable) with the mailing
builder.
`.o_no_editable` or other similar classes didn't seem to work.
Instead, the snippet has been revamped by removing the middle column and
adding a right border to the second column on each row.
This border is not yet editable in the builder, so the user cannot
adapt the width/color/style yet.

Bootstrap classes for text alignment have been replaced w/ inline styles

Part-of: odoo/odoo#95940
2022-08-11 17:56:24 +02:00
Elisabeth Dickinson b52806fcf0 [IMP] mass_mailing: references snippet improved
Replace bootstrap class for text alignment with inline style

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson f6c49e8c40 [IMP] mass_mailing: rating snippet improved
Changed `h4` to `h3`.
Removed padding when inside another snippet which already has its own
padding.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson 2a29f373f0 [IMP] mass_mailing: product_list snippet improved
Replaced bootstrap classes by inline styles and removed
`.o_default_snippet_text`.
Wrapping the `<a>` in a `<p>` allows the user to align the button
separately from the text.
On mobile, the columns are stacked, the paddings top and bottom are thus
moved to the columns to allow top and bottom spacing between them.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson fd22c5f974 [IMP] mass_mailing: picture snippet improved
Replaced bootstrap classes by inline styles and removed unused
`.figure-caption` class.

Allow columns and give image `max-width: 100%`

As the "thumbnail" option (in the image's Style option) is to be removed,
the `.img-thumbnail` class has been removed from the image.

The result can be done with the "padding" option already available on
images and the "border" widget that is to be added for its border-radius
option.
It is only missing a background-color to get the same result as the
styling given with the removed `.img-thumbnail` class.

Note: The styles are directly applied to the image element but Outlook
would need the styles to be applied to a wrapping element instead.
Outlook doesn't support styling directly on images.

Part-of: odoo/odoo#95940
2022-08-11 17:56:23 +02:00
Elisabeth Dickinson 125bf5552e [IMP] mass_mailing: numbers snippet improved
Replaced bootstrap classes by inline styles and removed
`.o_default_snippet_text` and `.s_number` classes which aren't needed.

`<h5>` is no longer supported, it's been changed to `<p>`.
Added `.o_cc` on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson e4cb8959cb [IMP] mass_mailing: media_list snippet improved
Padding improvements and removal of margin-bottom as this can't be done
with the builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson cd65d800b4 [IMP] mass_mailing: image_text and text_image snippets improved
Replaced bootstrap classes by inline styles.
Added .o_cc on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson 46b527f9f7 [REM] mass_mailing: footer_tag_line snippet removed
This snippet is already no longer in use.
The snippet is very similar to the call_to_action snippet

[REM] mass_mailing: title_text snippet removed

This snippet is already no longer in use.
In order to get the same result, we can use a combination of the title
and the text snippets.

Part-of: odoo/odoo#95940
2022-08-11 17:56:22 +02:00
Elisabeth Dickinson 66cc95830d [IMP] mass_mailing: features snippet improved
Replaced bootstrap classes by inline styles. Added .o_cc on columns to
allow background color edition with builder.

Mobile stacks the columns, the paddings top and bottom are thus moved to
the columns to allow top and bottom spacing between them.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 1789d2d505 [IMP] mass_mailing: features_grid snippet improved
Replaced bootstrap classes by inline styles and removed unused classes.
`<h4>` and `<h5>` are no longer supported, these have been changed to
`<p>` or `<h3>`.
Added .o_cc on columns to allow background color edition with builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 577e3fc1b5 [IMP] mass_mailing: coupon_code snippet improved
Replace bootstrap classes by inline styles.
Added a <p> around the ENDOFSUMMER20 text so it can be edited with the
design-tab along with other text.
A `.o_mail_no_margin` class is added to the <p> element otherwise the
text isn't vertically centered inside the the table cell.

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson b0ba58ede3 [IMP] mass_mailing: comparisons snippet improved
Removed unnecessary classes and replaced bootstrap classes with inline
styles.
Removed `.btn-block` classes because it isn't an option supported
by the builder.
The `<li>`'s `.list-group-item` class overrides the design-tab's text
color. For this particular case, the list elements have a `<p>` added
around the text.

When selecting text inside the second block's list and backspacing,
the line would become purple and impossible to remove. This was probably
due to the text being inside a <span> inside a <p> (this issue isn't 
present in the first block which only contains <p> elements).

Part-of: odoo/odoo#95940
2022-08-11 17:56:21 +02:00
Elisabeth Dickinson 9bdbb4440d [IMP] mass_mailing: company_team snippet improved
Placed all the columns in a single row, litmus tests approve.
Removed unnecessary classes which prevented to move columns around and
add background colors to the columns.
Also changed all `<h4>`s into `<h3>`s

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson f2cb22cab0 [IMP] mass_mailing: color_blocks snippet improved
Replace bootstrap class for text alignment with inline style

Wrapping the `a` inside a `p` and placing the text alignment on the `h2`
and `p`s allows the user to align the elements individually.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson f8b3782b44 [IMP] mass_mailing: call-to-action snippet improved
General improvements and removal of btn-block class as this is not
an option with the builder.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson 9c7264fb48 [IMP] mass_mailing: blockquote snippet improved
Removed unnecessary classes and placed necessary styles as inline styles
for better support by the builder.

Removed options.js which allows to change the blockquote's style as in
the web editor, but none of the other options is well supported in
emails. Due to this change, the blockquote's cover image is removed.

Changes to text done via the Design tab in the builder weren't being
applied to text inside `<span>`, so this has been changed to a `<p>`
element in order for the changes to be applied.

Part-of: odoo/odoo#95940
2022-08-11 17:56:20 +02:00
Elisabeth Dickinson 7eda17fd4d [IMP] mass_mailing: alert snippet improved
Structure and styling changed to allow padding X when this snippet is
not inside another snippet. Otherwise the alert block, in w-100, didn't
have any space between the edge of the email template and the block.

The "Type" option wasn't working: as all the elements can be changed
with other options anyway, the code for this one has been removed
instead of trying to fix it.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson bc48e48528 [IMP] mass_mailing: o_discount1 snippet improved and updated
Column classes have been updated and outdated classes ones have been
removed.
Paddings have been improved for better display on mobile.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson 2e3ecc52b5 [IMP] mass_mailing: header snippets improved
Previously, the social icons column could not be resized and we couldn't
change their alignment. This is now possible by removing the extra div
surrounding the social links.

A general cleanup has been done.
The order of the classes is more consistent.
Unused classes (ie: `o_mail_table_styles`) have been removed.
Text-align classes have been replaced by inline styles.

Part-of: odoo/odoo#95940
2022-08-11 17:56:19 +02:00
Elisabeth Dickinson 8db441a283 [IMP] mass_mailing: improve theme_default and default SCSS
In previous versions of templates, all the styles were needed in every
template in `<styles id="design-element">`. This is no longer the
case and it has been cleaned up to only use the styles that differ from
the "default" ones found in the  `mass_mailing_design_constants.js` file.

There was a priority problem (ex: `a.btn` inside `p` takes
`p`'s text color instead of `.btn`), this is resolved by placing the
default styling in `theme_default.css`

`theme_default.scss` contained classes that were no longer necessary or
would override styles from the builder. These have been removed from the
SCSS file and from snippets and templates where these were applied.
If the styles are needed, they should be added as inline styles.

The theme_default template was calling snippets with `t-call`
which prevented customization of the theme.
Snippets have been added in full with further customization.

task-2835454

Part-of: odoo/odoo#95940
2022-08-11 17:56:18 +02:00
Romain Estievenart c87b9e105c [FIX] mail: hide sharing screen button on mobile devices
The current implementation of sharing screen uses the
`MediaDevices.getDisplayMedia()` API. Sadly this API is not currently
supported by all major existing mobile browsers[1].
Some users were confused about the browser request permission
notification. As this is a way more complicated than just adding a
permission. We prefer to hide this feature by removing the screen
sharing button on mobile devices.

Links:
[1] https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=487935

opw-2915773

closes odoo/odoo#97947

X-original-commit: 2bf5ce06ef18d10c79ebab57551267eb31de872f
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-11 16:36:04 +02:00
aliya a82e09971a [FIX] account: fix drag and drop feature
Task 2888341

After the OWL update the drag and drop feature doesn't work anymore.
This little change does both things mentioned in the task: fixes the upload + shows the list view when the documents are uploaded

closes odoo/odoo#97671

Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-11 15:08:12 +02:00
Adrien Widart 320025ee63 [FIX] base: convert barcode type if incorrect encoding
To reproduce the issue:
(Need stock_barcode)
1. Create a product:
    - Barcode: 1234567890123
2. Print the label
3. Try to scan the barcode and check the value read.

Error: The value is 1234567890128, the last digit is incorrect (8
instead of 3)

When printing a barcode, we use the library 'report-lab' to generate a
barcode image from a value and a barcode type. In case of EAN-13, if the
value contains a non-digit character, it will raise an error. We then
catch the error and retry to generate the barcode according to the
barcode type Code128:
https://github.com/odoo/odoo/blob/87698d90f02bfe93c6e643f4876a5ccd74788eff/odoo/addons/base/models/ir_actions_report.py#L569-L575
However, if the value contains only digits, the method will use the 12
first digits:
https://github.com/mattjmorrison/ReportLab/blob/dade0f303cb6fcdbe535c4cc92e6102c2417b699/src/reportlab/graphics/barcode/eanbc.py#L187-L188
and will then add the last one, the check digit, which is computed by
the library. This explains why, in the above use case, the barcode value
returned by the scanner is not the same than the expected one.

Note: Similar behavior with type EAN-8

OPW-2902150

closes odoo/odoo#97052

X-original-commit: a2c7470f8fd46b2520f7b8f0750c63216273ce96
Related: odoo/enterprise#30160
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-11 12:51:05 +02:00
Pierre-Yves Dufays da5841ca3a [FIX] mass_mailing: spurious help overlay
When duplicating a mailing with a template already set, especially with a slow
connection, hitting the save button as soon as possible was causing the help
overlay to be superposed with the template. This solves the problem.

Task-2937045

closes odoo/odoo#97930

X-original-commit: 89ecb17f56b34b7e3875fa36cde70a2666dca4d8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-11 11:01:01 +02:00
Aurélien (avd) b455f5f36a [IMP] purchase: speed up dashboard rfq sent computation.
Add a new subtype_id for 'RFQ Sent' state. This removes
the need to join on mail.tracking.value when computing
'all_sent_rfqs'. Since mail.tracking.value is usually
a big table, removing this join leads to a substantial
speedup when loading the purchase.order dashboard on big
databases.

closes odoo/odoo#96921

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-08-11 11:00:49 +02:00
MerlinGuillaume 6c853953eb [FIX] stock: don't create empty move lines for receipts
When creating a receipt with products tracked by lot or serial number,
empty move lines are automatically created when the receipt is validated

Steps to reproduce:
1. Install Inventory
2. Go to Inventory > Configuration > Warehouse Management > Operations
   Types
3. Open Receipts and enable 'Show Detailed Operations' and 'Pre-fill
   Detailed Operations'
4. Go to Overview > Receipts and create a new receipt, in Detailed
   Operations add product 'Cable Management Box' with any serial number
   and a quantity of 1
5. Validate the receipt, a new line is added in Detailed Operations with
   quantity 0

Solution:
When we create a stock move line and we need to create a lot, we create
the lot with the context key `do_not_unreserve`

Problem:
When we create and write the lot on stock move lines, we detect that the
`product_uom_qty` is not set. Because we are in an immediate transfer,
we will try and assign it the `quantity_done`.
https://github.com/odoo/odoo/blob/7fec535f3d84d15899aea5e61b51947f260d9697/addons/stock/models/stock_move_line.py#L467-L469
By writing the `product_uom_qty` on the stock move, we will try to
unreserve and reserve again the stock move (if `do_not_unreserve` is not
in the context)
https://github.com/odoo/odoo/blob/ba3bb9b701a382c4052ddb57392baeee32625937/addons/stock/models/stock_move.py#L569-L576
This will then create the undesired empty move lines (that are supposed
to be the 'Pre-filled Detailed Operations') in _action_assign
https://github.com/odoo/odoo/blob/3e8a45fce0af0aa5792f0aea978d4ab78ab50a40/addons/stock/models/stock_move.py#L1586

opw-2897875

closes odoo/odoo#95983

Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-08-11 11:00:46 +02:00
Samuel Degueldre 61b0de8b3f [FIX] website_slides: fix broken one2many in form view
With the conversion to the new views, legacy x2many fields go through a
thin and incomplete compatibility layer to talk to the new model. This
compatibility layer is not very robust and as such most custom x2many
fields are broken in this configuration, in this case the field
"slide_category_one2many".

The proper fix is to convert this field widget, but in the mean time,
the simple fix is to force this view to keep using the legacy view
instead of the new view.

closes odoo/odoo#97936

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-08-11 09:35:54 +02:00