Commit Graph
145684 Commits
Author SHA1 Message Date
Antoine Guenet ecad4b282e [FIX] web_editor: properly convert inherited and inline color styles
The mass mailing transpiler wrongly applied inherited colors to children
and failed to take inline styles into account, while those are supposed
to have the highest specificity.

Part-of: odoo/odoo#77724
2021-10-04 15:31:12 +00:00
Antoine Guenet 6e5827e472 [FIX] web_editor: prevent glitches on field html iframe loading
When loading a field html iframe, there are sometimes display glitches
due to the iframe's contents and assets loading lazily. This prevents
those glitches by hiding the iframe until it is fully loaded, creating
a better user experience.

Part-of: odoo/odoo#77724
2021-10-04 15:31:12 +00:00
Antoine Guenet 47584e6716 [IMP] mass_mailing: show body_arch in readonly, body_html in a debug tab
The body of a mailing is saved in two fields: body_arch without
modifications, and body_html with conversion for email client
compatibility. Prior to this commit, we were showing body_html when
opening the form view of a saved mailing in readonly. This was pretty
strange and confusing as it's a sort of intermediary version that
doesn't mean much: an in-browser rendering of html that is compiled for
email clients.
With this commit, we change the view to always show body_arch instead.
A new tab is introduced in order to show body_html for debugging, which
is therefore only visible in debug mode.

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Antoine Guenet 0249b0ce1a [REF] mass_mailing, website: rename conflictual snippet options classes
The css of some website snippets conflicted with their mass_mailing
equivalents. A quick, non-intrusive solution had been to contain that
css so it wouldn't conflict. This replaces that solution with the more
neighborly renaming of said snippets in mass_mailing. This way there is
no added awareness of mass_mailing within the code of website.

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Antoine Guenet ff9a77c4be [FIX] mass_mailing, web(site,_editor): restore original website options
Commit [1] copied a lot of website snippet options into mass mailing.
Some were moved to web_editor and xpathed to be used in both without
duplicating code. Sadly that is not without side effects and it was
therefore decided to duplicate them instead so they can live separate
lives in the future.

[1] https://github.com/odoo/odoo/commit/4f7cd33d0fd69ee5984d0968233ffc73d7751030

Part-of: odoo/odoo#77724
2021-10-04 15:31:11 +00:00
Elisabeth Dickinson ec39e48ea6 [IMP] mass_mailing: optimize snippet images
Reduce snippet images' file sizes to be under 100kb.

task-2554899

X-original-commit: 982ab71c01a52c53dc5f1ac90904962b1c52eba5
Part-of: odoo/odoo#77724
2021-10-04 15:31:10 +00:00
Elisabeth Dickinson 62f766b36c [FIX] website: stop website snippets CSS from affecting mailing snippets
CSS from website's snippets was affecting snippets in mass_mailing with
the same class. To counteract this, we adapted the selector to exclude
mailing snippets.

task-2554899

X-original-commit: 40348e9c314bb1211b8a49690311733abcb4ada6
Part-of: odoo/odoo#77724
2021-10-04 15:31:10 +00:00
Antoine Guenet a9d4603b37 [ADD] mass_mailing: temporarily restore removed templates
This commit is there to be reverted in master. It temporarily restores
templates previously removed so as not to break migrations.

- s_mail_block_banner
- s_mail_block_title_sub
- s_mail_block_paragraph
- s_mail_block_comparison_table
- s_mail_block_two_cols
- s_mail_block_three_cols
- s_mail_block_image_text
- s_mail_block_text_image
- s_mail_block_image
- s_mail_block_footer_separator
- s_mail_block_steps
- s_mail_block_discount2

task-2554899

X-original-commit: d49b1942d33a222ac9159e76f7931cb89a85016f
Part-of: odoo/odoo#77724
2021-10-04 15:31:10 +00:00
Elisabeth Dickinson de89159448 [FIX] mass_mailing: add styles to <head> for mail client compatibility
This adds a series of CSS styles to the `<head>` of mailings in order to
ensure better mail client compatibility.

task-2554899

X-original-commit: ace475defca0c143d707f7b53d9f19a9db6cfe3e
Part-of: odoo/odoo#77724
2021-10-04 15:31:09 +00:00
Elisabeth Dickinson 351bcdedc2 [IMP] mass_mailing: apply default background color to all HTML mailings
This applies a default background color to all HTML mailings in order to
emphasize the separation between the mailing itself and its body.

task-2554899

X-original-commit: 75cbf5a559f891546c92f9079eb4d8dd22ac5e6b
Part-of: odoo/odoo#77724
2021-10-04 15:31:09 +00:00
Elisabeth Dickinson d328063349 [ADD] mass_mailing: add an empty template to drop snippets into
This adds an empty template to `mass_mailing`, in which snippets can be
dropped, to start an HTML mailing from scratch.

task-2554899

X-original-commit: 7522272f42b38ef2f47e2432660bcf6a3030795c
Part-of: odoo/odoo#77724
2021-10-04 15:31:08 +00:00
Antoine Guenet 1ab19096fe [FIX] web_editor: properly display icons in iframe sidebar
`we-button`s, `we-toggler`s and `we-select-items` with no text content
don't properly take up their full height in iframes. This solves that
issue by ensuring a text content at all time, albeit an invisible one.
This is a bit of hacky solution perhaps but one that consistently works
across browsers.

task-2554899

X-original-commit: e59ad49cb9f32240d8ca3c89fc20ab200e291adc
Part-of: odoo/odoo#77724
2021-10-04 15:31:08 +00:00
Antoine Guenet d240d3a2ee [IMP] web_editor, mass_mailing: disable transparency in mass mailing
Transparency is not supported in several leading mail clients. This adds
the option to completely remove transparent colors from the palette, and
uses that option in `mass_mailing`.

task-2554899

X-original-commit: 4e2c859b6d4fb8d9c12e24d1c8ebc84aa0f3c72e
Part-of: odoo/odoo#77724
2021-10-04 15:31:08 +00:00
Antoine Guenet 82711f772a [FIX] web_editor: properly drop to nearest in iframe
The feature to drop snippets to the nearest allowed position was broken
in iframes because of a reference to a JQuery contained in a different
document than the editable area. This restores the feature in all cases.

task-2554899

X-original-commit: 4be474283f7fb6abbea8707d346f0d71939efce2
Part-of: odoo/odoo#77724
2021-10-04 15:31:08 +00:00
Antoine Guenet 38c8533575 [FIX] mass_mailing, web_editor: prevent dropping snippets out of mailing
Prior to this commit, it was possible to drop snippets out of the
confines of the mailing's body and into its editable parent instead.
This makes that impossible.

task-2554899

X-original-commit: e3942e4aa1391ca82a946d4b6b3823d2690733ee
Part-of: odoo/odoo#77724
2021-10-04 15:31:07 +00:00
Antoine Guenet b3706f1afc [REM] mass_mailing: remove unnecessary table-related snippet
`mass_mailing_table_item` was charged with ensuring proper cloning and
removing of table elements precisely because `mass_mailing` relied so
heavily on them. Since it doesn't anymore, there is no need for that
option. This removes it.

task-2554899

X-original-commit: 386848568adb8e11f57e458cb7862cb3058b07c9
Part-of: odoo/odoo#77724
2021-10-04 15:31:07 +00:00
Antoine GuenetandElisabeth Dickinson d0c2d8e9a1 [ADD] mass_mailing, web[site|_editor]: website snippets to mass_mailing
The following snippets (and their relevant options) were added to
`mass_mailing`, mostly duplicated from the website builder:

- s_cover
- s_title
- s_text_block
- s_comparisons
- s_color_blocks_2
- s_three_columns
- s_image_text
- s_text_image
- s_picture
- s_features
- s_numbers
- s_masonry_block
- s_media_list
- s_showcase
- s_company_team
- s_call_to_action
- s_references
- s_product_list
- s_features_grid
- s_alert
- s_rating
- s_blockquote
- s_hr
- s_text_highlight
- s_coupon_code

The following snippets were removed to make way for the new:

- s_mail_block_banner
- s_mail_block_title_sub
- s_mail_block_paragraph
- s_mail_block_comparison_table
- s_mail_block_two_cols
- s_mail_block_three_cols
- s_mail_block_image_text
- s_mail_block_text_image
- s_mail_block_image
- s_mail_block_footer_separator
- s_mail_block_steps
- s_mail_block_discount2

The following standalone snippet options were added, mostly duplicated from the
website builder:

- Box
- layout_column
- SnippetMove
- snippet_options_text_align (via web_editor)
- snippet_options_width (via web_editor)
- snippet_options_block_align (via web_editor)
- BodyWidth (based on ContainerWidth but only for the mailing's body)
- minHeight
- so_snippet_addition
- so_content_addition
- sizing_x
- vAlignment

Styles and selectors were adapted to the specifics of `mass_mailing`.

task-2554899

X-original-commit: e5e1d4255ab416581b2ef7159c0c28540528771c
Part-of: odoo/odoo#77724
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2021-10-04 15:31:07 +00:00
Antoine Guenet 5de7bdb924 [IMP] (website_)mass_mailing: convert tables to bootstrap grids
The new automatic conversion from Bootstrap grid to tables allows us to
convert `mass_mailing` templates from their old table structures to
Bootstrap grid (as the reverse conversion will now be applied on save).

General heuristic for the conversion of templates:

|      **Table**      |                **Bootstrap**               |
|:-------------------:|:------------------------------------------:|
|      `<table>`      |          `<div class="container">`         |
|      `<thead>`      |                 _(removed)_                |
|      `<tbody>`      |                 _(removed)_                |
|      `<tfoot>`      |                 _(removed)_                |
|        `<tr>`       |             `<div class="row">`            |
|        `<th>`       |       `<div class="col o_col_head">`       |
|        `<td>`       |             `<div class="col">`            |
| `<td width="_n_%">` | `<div class="col-_o_">` where o ~= 12n/100 |
|    `cellspacing`    | _(removed but always added back to table)_ |
|    `cellpadding`    | _(removed but always added back to table)_ |
|       `border`      | _(removed but always added back to table)_ |

Some styles had to be changed to account for the difference in the HTML.

task-2554899

X-original-commit: c26dac24c5fd15165935c770175c1b6f87aaad41
Part-of: odoo/odoo#77724
2021-10-04 15:31:06 +00:00
Antoine Guenet 066e1c7c84 [IMP] mass_mailing: multiple transpiler improvements
This brings a series of improvements to the mechanism in place to
convert the output html of mass mailing into html that is more compliant
with the main mail clients' requirements.

The biggest change is the automatic conversion of Bootstrap grids into
table structures. Currently all templates in `mass_mailing` are designed
with tables so they work in mailings as is. That has limitations though
as it makes it less easy to edit with snippets such as those used in the
website builder. This new automatic conversion from Bootstrap grid will
allow us to adapt the mailing and snippet templates and be more free
within `mass_mailing`.

Note: Because of the limited support of media queries in emails, this
doesn't support the mixing and matching of column options
(e.g., `"col-4 col-sm-6"` and `"col col-4"` aren't supported).

Other changes include:
- The conversion of Bootstrap cards to table structures
- The conversion of Bootstrap list-groups to table structures
- The conversion of snippets (.o_mail_snippet_general) and mailings
    (.o_layout) into table structures
- The conversion of all rgb colors to hexadecimal
- The conversion of all "rem" sizes to "px"
- Various small corrections to the output styles

task-2554899

X-original-commit: e2e00939e09220051f6f4ecfb7bb3276105387bf
Part-of: odoo/odoo#77724
2021-10-04 15:31:06 +00:00
Patrick Hoste 7bfb6d7f01 [FIX] (website_)event_booth(_sale): fix display default booth category image
PURPOSE

Before this commit when a booth category doesn't have an image a
traceback is shown when accessing to the /booths route.
After this commit a default image is shown when the booth category
doesn't have an image.

SPECIFICATION

To allow the public user to see the booth category image we give
everybody the read permission on the model but restrict some
sensitive fields.

LINKS

Task-2635461

Pr: odoo/odoo#77081
Related: odoo/upgrade#2869
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-10-04 15:30:26 +00:00
Patrick Hoste 1264eb9280 [FIX] website_event_booth_sale: fix typo type to detailed_type
PURPOSE

A typo has been made with the following commit:
https://github.com/odoo/odoo/commit/3d7b9bbf27298dc7f2f7e61a13120988f9bd422a
This typo made the test unreachable so this commit corrects it.

LINKS

Task-2635461
PR: odoo/odoo#77081
2021-10-04 15:30:26 +00:00
Patrick Hoste a2fe1cfb33 [IMP] (website_)event_booth(_sale): polish ux design
PURPOSE

This commit is a first polish for event booth modules. It includes:
- wording
- add currency on price fields
- removing booths tab on event view

LINKS

Task-2635461
PR: odoo/odoo#77081
2021-10-04 15:30:26 +00:00
Patrick Hoste 2fab359e32 [IMP] website_event_booth(_sale): change registration success redirect to ajax call
PURPOSE

Before this commit when confirming a registration on the frontend the form
was directly sent to the controller and the user was redirected on the
success page if no errors.
After this commit an ajax call is made after validating the form and the
success page is directly loaded from the response... there is no redirect
anymore.

This way of displaying the success page prevent using the link generated
before by another user and getting private information about the booth's
renter.

Two more advantages are that it's easier to maintain and it's slightly
faster than before since the whole page isn't reloaded.

LINKS

Task-2635461
PR : odoo/odoo#77081
2021-10-04 15:30:25 +00:00
Simon Genin (ges) e3cf794cc1 [IMP] test_lint: add no-dupe-class-members rule
closes odoo/odoo#77719

X-original-commit: 591a94f6278abf51b114fd43870874c6ea8364ab
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-04 14:12:42 +00:00
Andrea Grazioso (agr-odoo) e34ca20bc3 [FIX] l10n_it_edi: send credit note to edi
opw-2654793

closes odoo/odoo#77716

X-original-commit: 680b7cac3214dc107fa3d9ad6e2e807721673312
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-10-04 14:12:35 +00:00
Hubert Van de Walle (huvw) 7ea4eeae86 [FIX] mail: exception when sending an email with \n in the record_name
Step to follow:

  - Create an Asset Models
  - Set up the Fixed Asset Account:

  Automate Asset -> Create in draft or Create and validate
  Asset Model -> The one you have just created

  - Create a Vendor bill

  Account -> the Fixed Asset Account of the asset model created
  Label -> insert a newline
  Price -> (do not forget to set a price)

  - Validate
  - Go to the asset automatically created
  - @ mention a user in the chatter

Cause of the issue:

  The generated email subject comes from the record_name and it can
  contain newlines
  Email headers don't allow newlines and an exception is thrown here
  https://github.com/python/cpython/blob/60b93d9e4922eeae25052bc15909d1f4152babde/Lib/email/policy.py#L143

Solution

  Replace newlines by spaces in the email subject

opw-2522055

closes odoo/odoo#77712

X-original-commit: ed343998d39ff91a3f73cc8012be498d32c91b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-04 14:12:30 +00:00
Andrea Grazioso (agr-odoo) fe82ccc860 [FIX] link_tracker,website_links: use specific site url
- Create 3 websites and set a website domain for each
- Install the website_links module
- Go to Website > Configuration > Settings
- Select the website 3
- Go to website
- Menu Promote > Link tracking

The URL field uses the domain you are logged into the database
rather than the domain of the active website

The expected behavior is:
With an ICP set to URL1, a website 1 set to URL2 and a website 2 set to
URL3, going to the link tracker website page from URL3 but with website
1 selected should:

Show the current website domain as placeholder of the input -> URL2
Create link for that current website the user selected -> URL2

opw-2638494

closes odoo/odoo#77705

X-original-commit: d094d76354d6f46db3dc7f8e716b5f778ca26569
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-10-04 14:12:26 +00:00
Akim Juillerat 18e805d0e6 [FIX] account: usage of self in loop of payment register compute
closes odoo/odoo#77699

X-original-commit: 7936736f208cd7483ae8b9a508cf7387cd504b83
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-04 14:12:19 +00:00
David Monjoie ce639f28a9 [FIX] web_editor: fix img being removed on copy/paste
The img nodes where being wrongly considered empty by isShrunkNode
because the image was not loaded yet.

closes odoo/odoo#77646

X-original-commit: d18d51191bca8f063effd4a216c3963c187a8767
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-04 14:12:15 +00:00
Rémy Voet (ryv) c7f32658ce [FIX] base,website_crm_partner_assign: fix exists() model with _table_query
The exists method (of BaseModel) doesn't work with model
without SQL table but with a table query (see
f2ceef0e2f)
This method is call when we try to read a forbidden
record (`forbidden = missing.exists()` in `_read`)

- Fix it by using a Query object (which able the case).
- Also use a partition method instead of duplicate it in the method.
- Fix the CRM Lead Report which can return a Falsy id

task-2633558

closes odoo/odoo#77644

X-original-commit: 70a68615c722e7145b2ba8bb7ca86a8373b5aa4e
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-04 14:12:11 +00:00
ijas ahammed ec7f7405e7 [IMP] website_event_questions: update the constraint validation message
- If we try to delete an answer which is already been selected by attendees,
  it throws a validation error saying "There must be suggested value or
  text value". The constraint here does important check, which makes sure that
  the answer must have a valid value (either selection or text) otherwise the
  answer record is of no use, and keeping such records doesn't make sense.
  Thus it prevents corrupting the historic responses. For example, if attendees
  answered a selection question with particular option and we try to delete the
  same option from event question, the constraint will not let us delete that,
  because the answers with this option selected will be of no use.

  However, the current validation error message does not make it clear to the
  user trying to delete the selection options which are present in the answers.

- The same goes for event questions. If we try to delete a question which is
  already been answered by attendees, it throws a raw sql error message to
  prevent corrupting the historic responses.

With this commit, we simply improve the validation error messages for both the
above cases. While deleting the answer selection, we now raise a UserError from
`_unlink_except_selected_answer` method saying "You cannot delete an answer
that has already been selected by attendees." And while deleting the question
itself, we now raise a UserError from `_unlink_except_answered_question` method
saying "You cannot delete a question that has already been answered by attendees."

TaskID-2635599

closes odoo/odoo#76265

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-04 14:12:06 +00:00
David Monjoie f312e1359a [FIX] web_editor: do not encode link text
These encode/decode shenanigans seem to be unnecessary since we are not
using summernote anymore. Moreover, the encode process was destroying
the html structure of nodes contained in the link, only making a special
case to maintain images. This is not sufficient anymore because the
Cards option of website mega menu does make use of custom html content
inside a link. This content was therefore destroyed on edition and
replaced by its textContent because of the encode function.

task-2652361

closes odoo/odoo#77654

X-original-commit: 80004b1819fa1e1e7cfdd03a285de9d4ee845356
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-04 12:51:56 +00:00
Kevin Baptiste 67a07865d1 [IMP] (hr_)fleet: improve Claim Car Report
The "Claim Car Report" action was not working as expected.
Now the statbutton "Cars" will show the car history of a specific
driver.

closes odoo/odoo#76550

Related: odoo/upgrade#2882
Taskid: 2646113
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-04 11:29:55 +00:00
dht-odoo 67bcdbb2a2 [IMP] crm: improve visibility of partner_id field in lead form view
When the crm.lead is of type 'lead', we don't want to display the
"Customer" field on the form view unless it's set (or debug mode).

Indeed, most of the times leads will not have this information set,
since when we assign a Customer we usually convert the lead to
an opportunity as well.

This means that on the lead form, we don't want to display this field
since it may be misleading for the end user.

When it's set however, we want to display it, mainly because there are
a few automatic synchronizations between the lead and its partner
(phone and email for examples), and this needs to be clear that modifying
one of those fields will in turn modify the linked partner.

Task-2596955

closes odoo/odoo#76233

Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-10-04 11:29:51 +00:00
oco-odoo 80e8f11796 [IMP] account: forbid creating multiple foreign VAT fiscal positions for the same region
Having the same VAT fiscal position for the same region multiple times doesn't make sense and is not supported by the report enfinge. We should prevent that.

closes odoo/odoo#77663

X-original-commit: d9dfeeb498dab359df52db87ff601d68fcf0ad7c
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-10-04 09:16:25 +00:00
oco-odoo e4f9859722 [IMP] account: improve fiscal positions' form view
The 'Country Group' field should be displayed under the 'foreign VAT' one, so that it its grouped together with 'Country' and 'Federal states'.

X-original-commit: 302586c6b35825e19945b92faa48ccc892179ea6
Part-of: odoo/odoo#77663
2021-10-04 09:16:25 +00:00
Sébastien Theys 2f700dd9a7 [FIX] mail, *: avoid concurrency issue of RTC sessions
* = test_discuss_full

Before this commit if 2 persons are joining the call at the exact same time, the
join RPC of each will return the list of RTC sessions without the other person
included.

In more general terms, the server should actually rarely send the full state to
the JS (in this case "use the replace command") because there is no guarantee
that a concurrent transaction is not changing the data at the same time. In
other words, even the python is actually working with partial knowledge
relatively to the database.

Using a DB lock would guarantee it, but we don't want to lock tables and wait on
locks if there are alternatives. In this case it is acceptable to keep obsolete
sessions for a little bit longer, as long as they are cleared eventually.

closes odoo/odoo#77656

X-original-commit: d3a84172fc78f5783f75aa1155f1a25e4f9614b7
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-04 09:16:19 +00:00
Sébastien Theys 71452c334f [FIX] mail: remove annotateTraceback because it is extremely slow
It could take seconds to annotate a simple stack trace, it is therefore not
suited at all for quick logging as we do in RTC.

It's unfortunate but acceptable to just log the non-annotated stack trace in
that case.

X-original-commit: 8b3495c489c274e878d2a0938ea29b4da17710aa
Part-of: odoo/odoo#77656
2021-10-04 09:16:19 +00:00
Thibault Libioulle 2d15f586fd [IMP] project: add test on recurring subtasks
This commit adds a test in order to strengthen the behaviour of
recurring subtasks.

This test asserts that child with depth > 3 are not copied in a
recurrence, that recurrent subtask are well copied with the recurrence
correctly set.

This commit prepares the recurrence refactoring.

task-2660756

closes odoo/odoo#77632

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-10-04 09:16:13 +00:00
Nathan Marotte (nama) b4e11b7dc5 [FIX] sale_stock_margin: Traceback after reset to quotation avco kit SO
Issue: With margin enabled and avco for stock valuation, after
confirming a SO with a product variant which is a bom kit,
when we try to change the variant, there is a traceback

Steps to reproduce :
1) Install Stock, Accounting, MRP, Sale,
2) Enable Margins in settings

3) Configure a Product Category with costing method AVCO
4) Configure a Product with 2 variants and that product category
5) [Important: KIT] Create 2 BoM, one for each variant and set those
BoM to KIT
6) Create a SO for that product and one variant
7) Confirm the SO, cancel it, and set to quotation
8) Edit the SO and change the variant, save
-> Traceback

Side-Note:
 This issue is due to the fact that we iterate over the stock_moves to
 find the quantity of the BoM, but that stock_move correspond to
 confirming at step 7, when we change the variant at step 8, the stock
 move has not changed, so still contains the previous bom_line_id with
 the quantity, but this doesn't reflect with the new state of the SO
 which is for a different variant.

 For me since the stock move is canceled, it should be taken into
 consideration when computing the average price but I might be wrong,
 it's up to the reviewer to decide if it makes sense

opw-2639093

closes odoo/odoo#77606

X-original-commit: c0d4ed5ac641d339a6cd4e23db9667048d35360d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-04 09:16:09 +00:00
Andrea Grazioso (agr-odoo) 388ccdfb06 [FIX] pos_sale: add delivery address when generating invoice
When invoicing via POS delivery address is missing on the invoice.
This value is needed in some localizations (i.e. l10n_co) to correctly
validate the invoice

opw-2653661

closes odoo/odoo#77556

X-original-commit: d57a44d875eabba0586e24245a9af435169fda22
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-10-04 09:16:05 +00:00
Goffin Simon 546ce6416b [FIX] sale_coupon: Prommotional program applied on canceled SO
Steps to reproduce the bug:

- Create a promotional program P with 'Fixed amount' discount of $50 and 'Automatically applied' on current order
- Create SO and cancel it

Bug:

P was applied on the canceled SO

opw:2579344

closes odoo/odoo#77455

X-original-commit: 8f11cabcb605cab5c83e4889156e4979d55aa517
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-10-04 09:16:00 +00:00
Philippe Wauthy b34d68c842 [IMP] hr_holidays: delete from dashboard in year view
Previously, the land page of Time Off was month view. When you select a leave from Month's view, you can edit/delete it directly.
Now, the land page is Year's view, and you can open the modal form of the leave, but it's not possible to delete it.
Add a delete button on the form view of the leave from the year's view of the dashboard

task-2638305

closes odoo/odoo#76080

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-04 09:15:56 +00:00
oco-odoo dfce5361a0 [IMP] account: add preceding_subtotal as optional field in tax groups' tree view
For usability.

closes odoo/odoo#77662

X-original-commit: 360ed18185a420eaccfa1c47aaeee931c7f1fa55
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-10-04 07:57:18 +00:00
oco-odoo ba126f6af6 [IMP] account: add debug menu to see tax groups
No menu allowed viewing all tax groups at once before. With the new subtotals features, it could become painful for the user if he wanted to change the groups' sequence in order reorder subtotals on his invoices (he had to change the sequence manually on each group, accessing their form view through taxes using them). It is now possible in the tree view opened by our new menu, with the sequence widget.

X-original-commit: 708899fc0e1a793f29884d82b34ba6c492461737
Part-of: odoo/odoo#77662
2021-10-04 07:57:18 +00:00
Elisabeth Dickinson 5c056b6228 [FIX] mass_mailing: add button styling
"Rounded" and "Flat" buttons didn't have their proper styling
if the website module was not installed.
Styles for rounded and flat buttons have been added to theme_default.scss

closes odoo/odoo#77661

X-original-commit: 74540364428e9d5a308a1012ae8614aa37ecb8a6
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-10-04 07:57:12 +00:00
Francois (fge) 3e7996a448 [FIX] web: expanded search item
Let us assume we have a slow network and a (new) search bar with two
items, one of them expandable.
Before this commit, click to expand that item and then hover the other
item quickly would not end in a situation where the item is expanded.
This was due to a naive concurrency management in the (new) SearchBar
component.

In this commit, we allow to focus another item (via the mouse or the
keyboard) without cancelling an ongoing asynchronous operation.

closes odoo/odoo#77655

X-original-commit: 6fc0c5ee2d1d68bf82a034fe1744ac5673e522c9
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2021-10-04 07:57:08 +00:00
b63ee52552 [FIX] *: remove scss 'extend' from dropdown components
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.

Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.

In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.

Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.

// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
  <button class="dropdown-item" type="button">Action</button>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
  <li class="o_dropdown_item">
     <span>Action</span>
  </li>
  <li class="o_dropdown_item">
     <a href="#">Another action</a>
  </li>
</ul>

// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
  <span class="dropdown-item">Action</span>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)

closes odoo/odoo#77649

X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-04 07:57:00 +00:00
Mohammed Shekha 63099f5b13 [FIX] web: center o_cp_action_menus div
Since commit a1f286916d o_cp_action_menus is not centered
anymore as justify-content: space-between; was removed from scss.

with this commit we are making o_cp_action_menus centered again.

task-2628050

X-original-commit: 590d0ca81382d4c3d6007bdf9bf65ed3a0ed795e
Part-of: odoo/odoo#77649
2021-10-04 07:57:00 +00:00
Uku Lagle a9f19d09dd [FIX] account_facturx: gross price must be subtotal not unit price
Facturx expects line price to be subtotal, not unit price. Odoo parser
is also dividing the gross price by quantity. So before this commit,
importing PDF invoice rendered by Odoo, results in: unit price / quantity.

The bug was introduced in odoo/odoo#53894

closes odoo/odoo#77527

X-original-commit: 3769a6cdda259a839f00267d99a57f2aa3d89aa1
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-10-04 07:56:54 +00:00