Commit Graph
145701 Commits
Author SHA1 Message Date
Géry Debongnie 6d67d02ece [IMP] web: update owl from 1.4.4 to 1.4.6
Release notes:

https://github.com/odoo/owl/releases/tag/v1.4.6

- fix: crash in component render (in rare cases)
- fix: build system now target ES2017 instead of ESNext
- fix: remove useless log in prod mode

https://github.com/odoo/owl/releases/tag/v1.4.5

- qweb: expose translatable attributes
- ci/tests: update jest/rollup
- doc: clarify tutorial
- doc: update readme, add nice badges

closes odoo/odoo#77835

X-original-commit: aa2cfb63932d28821a4a333d5162827392bf3366
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-05 14:16:54 +00:00
william-andre c03924bfbb [FIX] account: manage multiple ids in _is_end_of_seq_chain
`_deduce_sequence_number_reset` should be used on maximum one record.
That function is called from `_get_sequence_format_param` in
`_is_end_of_seq_chain` but that function was possibly calling it on
multiple ids.

https://runbot.odoo.com/runbot/build/10315612

closes odoo/odoo#77811

X-original-commit: 10b880ae999643a4e3e9328d96196a19b0cf7ac6
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-05 14:16:50 +00:00
Denis Ledoux d979f5970d [FIX] payment: compute methods shouldn't write
`compute` shouldn't write things. This means `writes` can occur
just by reading records.

Instead, when you want to assign multiple compute fields at once,
`update` should be used.

```
2021-10-04 12:42:21,132 61 ERROR db_40421 odoo.upgrade.base.tests.test_mock_crawl: FAIL: TestCrawler.test_check
Traceback (most recent call last):
  File "/tmp/tmpn37k1zm_/migrations/testing.py", line 208, in test_check
    self.check(value)
  File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 85, in check
    self.assertFalse(diff, msg)
AssertionError: [('payment.payment_acquirer_menu', 217, 'Accounting > Configuration > Payments > Payment Acquirers', 312)] is not false : At least one menu or view working before upgrade is not working after upgrade.

('payment.payment_acquirer_menu', 217, 'Accounting > Configuration > Payments > Payment Acquirers', 312):
 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 879, in get
    return field_cache[record._ids[0]]
 KeyError: 8

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
   File "/home/odoo/src/odoo/15.0/odoo/api.py", line 882, in get
    raise CacheMiss(record, field)
 odoo.exceptions.CacheMiss: 'payment.acquirer(8,).show_credentials_page'

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 182, in crawl_menu
    self.mock_action(action_vals)
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 293, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
   File "/tmp/tmpn37k1zm_/migrations/base/tests/test_mock_crawl.py", line 319, in mock_view_form
    [data] = record.read(fields_list)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3227, in read
    return self._read_format(fnames=fields, load=load)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3247, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5867, in __getitem__
    return self._fields[key].__get__(self, type(self))
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1106, in __get__
    self.compute_value(recs)
   File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1265, in compute_value
    records._compute_field_value(self)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4249, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/15.0/addons/payment_transfer/models/payment_acquirer.py", line 21, in _compute_view_configuration_fields
    super()._compute_view_configuration_fields()
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 168, in _compute_view_configuration_fields
    'show_cancel_msg': True,
   File "/home/odoo/src/odoo/15.0/addons/payment_transfer/models/payment_acquirer.py", line 41, in write
    res = super().write(values)
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 234, in write
    self._check_required_if_provider()
   File "/home/odoo/src/odoo/15.0/addons/payment/models/payment_acquirer.py", line 260, in _check_required_if_provider
    _("The following fields must be filled: %s", ", ".join(field_names))
 odoo.exceptions.ValidationError: The following fields must be filled: Email
```

upg-40421

closes odoo/odoo#77752

closes odoo/odoo#77827

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-10-05 12:36:04 +00:00
root 50f6e5f2be [IMP] mail: quick-open related record from message
Before this commit if you found a message and wanted to open the related record you would need to find it manually by finding the right view and then using the ID stored on the message to open it.
By adding a smartbutton the user can quick-navigate to the related record in a second.
This allows for quickly finding and opening records which is usually handy when debugging things.
Ref Task-2660873

closes odoo/odoo#77675

closes odoo/odoo#77803

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 12:36:00 +00:00
Sébastien Mottet (oms) aaef93c017 [FIX] website: keep configurator images on theme switch
On theme switch default images of the previous theme are replaced
by the one of the new theme. For website where default images
come from the configurator we don't want them to be replaced by
the theme's images.

task-2614840

closes odoo/odoo#77648

X-original-commit: c25f80c70930f65a928b44d4fe91775c37bc4268
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-10-05 12:35:56 +00:00
Julien Banken fbedc9c0b9 [IMP] website: improve the visitor kanban card of the website module
On the page 'Visitors' page of the website module (backend), the cards
can be miss-aligned on small screen size. To improve the responsiveness
of the cards, we will use the `col` and `col-*` classes of Bootstrap
with some specific breakpoints (e.g. `col-sm-*`, `col-lg-*`, etc). We
will also use flex display to reduce the number of custom css rules.

task-2524363

closes odoo/odoo#73355

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 12:35:52 +00:00
Francois (fge) 71213bdb77 [FIX] web: _t missing in debug_menu
closes odoo/odoo#77749

X-original-commit: a182fc9d078fba7d041563c8bda157bc3d142c2e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-05 07:27:24 +00:00
Nicolas (vin) 9812d135af [ADD] Added VAT report for Italy and simplify tax templates
The Italian VAT report is needed to help Italian customers fill in
their VAT report.

Task id #2079462

X-original-commit: 570afc9f237ce6048bd412dd6f3cd7ad38ffb17a
[ADD] Added VAT report for Italy and simplify tax templates

The Italian VAT report is needed to help Italian customers fill in
their VAT report.

Task id #2079462

closes odoo/odoo#77565

X-original-commit: 616839df835283b5d682323cf96bbae579d3900a
Related: odoo/enterprise#21330
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-10-05 07:27:20 +00:00
Guillaume (guva) 5490d4eb94 [FIX] accounting: have the right order for bank statement
Steps to reproduce:

- Go to Accounting -> Cash Registers
- Create a first statement named E, add a line with amount 100,
  set the Ending Balance (balance_end) to 100.
- Create a second statement named H, add a line with amount 50,
  set the Ending Balance (balance_end) to 150.
- Create a third statement named C, add a line with amount 1,
  set the Ending Balance (balance_end) to 151.
- Create a last statement named as you want.

Issue:

The Starting Balance of the last statement is compute from the
Ending Balance of statement H instead of statement C.

Cause:

Because of the _order = 'date desc, name desc, id desc', if several
statements have the same date, the name is taking into account to
classify the statements, which cause issue because the name doesn't
always reflect the chronological order of creation.

Solution:

Change the order to 'date desc, id desc' when we get the previous
statement.

opw-2635092

closes odoo/odoo#77757

X-original-commit: 8a9982856318068f64e5bbdbe2c120e8c6d52097
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: guva-odoo <guva-odoo@users.noreply.github.com>
2021-10-05 06:11:07 +00:00
Nasreddin Boulif (bon) 0e576c9700 [FIX] web: Display properly company phone in report
Steps to reproduce :

  - Install Sales
  - Modify the report, use the theme "Clean" and the font "Open Sans"
  - Modify the company phone to: +41 26 322 01 02
  - Print a quotation

Issue :

  Company phone is on 2 lines

Cause :

  CSS issue with wkhtmltopdf.

Solution :

  Replace CSS display value `inline-block` by `inline`.

ref commit: https://github.com/odoo/odoo/commit/5b022f433a44e627541d30ae21d7a867f4a3a6ff
opw-2567836

closes odoo/odoo#77647

X-original-commit: d462f13e0c1c04e792895bba9f2edfb35d9ee9d3
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-10-04 21:33:47 +00:00
Raphael Collet ea72b1ff32 [FIX] base: warnings with context key 'validation_views'
The context key 'validation_views' is used by ir.ui.view to determine
what parts of a view arch must be validated.  Its associated value is
either True or a recordset, and having those types leads to unexpected
warnings when creating environments.

Before creating a new environment, the class Environment looks for an
existing environment with the given parameters: cr, uid, context, su.
The comparison of a context where 'validation_views' is a recordset with
another context where 'validation_views' is True, generates the warning
"unsupported operand type(s)"...

We avoid this situation by using ids instead of a recordset for the
value of the validation context key.

closes odoo/odoo#77747

X-original-commit: 210cd625a052a4d3c230a93bcba644c9a31e67ab
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-04 20:23:51 +00:00
Guillaume ClemensandTom De Caluwé bb6379e4f9 [IMP] website: add accordion styles
This commit adds new classes and options to the accordion snippet in
order to add new styles and allow switching the side where the collapse
status icon floats to.

task-2457232

closes odoo/odoo#69543

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-10-04 18:38:43 +00:00
William Braeckman 7f60ed43af [FIX] hr_attendance: fix missing context in kiosk mode
The context was missing from multiple RPC calls in the attendance's
kiosk modes resulting in the wrong employee being fetched for the
attendnace creation, all RPC calls related to attendances are now given
the context explicitely.

TaskId-2660772

closes odoo/odoo#77750

X-original-commit: 26c5e25481d93e5f9db6c4becefc4f17d3974eaf
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
2021-10-04 17:26:49 +00:00
Cedric Prieels (cpr) 5aaed9ec92 [FIX] project: improve performances of has any so to invoice compute
Before this commit, the compute _compute_has_any_so_to_invoice was not triggered
in case of user change, which means that it could take incorrect values depending
on the value of the group as it was missing the proper decorator.
Also, performances were not optimal and have been improved.

closes odoo/odoo#77748

X-original-commit: 1270bd5dbd51a80b3e60695da4374092c55d6e06
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-10-04 17:26:44 +00:00
Olivier Dony 2cf2b8cb6f [FIX] payment: fix access error in tx processing
The `callback_hash` and `callback_is_done` fields are not accessible
for non-admin users, so it will cause an access error whenever trying
to verify the hash inside `_execute_callback()`, and when marking the
callback execution successful.

Accessing it as `sudo` like other restricted transaction fields solves
the problem, and is safe, as the value is never leaked outside the
function.

Introduced in 573ed74c12.

closes odoo/odoo#77737

X-original-commit: 743031ed400b26f05775fc01c04ff63ef597a723
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-10-04 15:31:27 +00:00
Odoo's Mergebot 6c63addd18 [FW][MERGE] mass_mailing, web_editor, website: adapt to use new snippets and grid
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

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.

Mailings were limited to 600px width by default. This removes that limit in order to give snippets control over the margins.

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

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_footer_tag_line
- s_mail_block_steps

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`.

`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.

Prior to this PR, 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.

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.

`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.

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`.

A new, empty template to `mass_mailing` was created, in which snippets can be dropped, to start an HTML mailing from scratch.

A default background color is applied to all HTML mailings in order to emphasize the separation between the mailing itself and its body.

A series of CSS styles were added to the `<head>` of mailings in order to ensure better mail client compatibility.

task-2554899
Enterprise PR: https://github.com/odoo/enterprise/pull/21215

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#77724

Forward-port-of: odoo/odoo#77312 and odoo/odoo#77634 and odoo/odoo##77592
Related: odoo/enterprise#21400
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-04 17:31:14 +02:00
Antoine Guenet 71c4b35ea1 [FIX] web_editor: properly size text on transpiling for emails
The body's font size and line height were lost on transpiling it for
emails. This restores them by applying them to the mailing's top
element.

Part-of: odoo/odoo#77724
2021-10-04 15:31:12 +00:00
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