Commit Graph
152410 Commits
Author SHA1 Message Date
tsb-odoo 4a415aba2e [FIX] account: analytic account fix in multicompanies env
When using _prepare_analytic_distribution_line, it would take
the company for the line from the distribution, then the env.
This would cause multicompany issues in some case, creating the
line for the wrong company. By using current the move line to
get the company before falling back on the env, we can avoid such
an issue.

OPW-2900827

closes odoo/odoo#96465

X-original-commit: 8c10324f062e4cd239494545cdfce7cde7ffadbb
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-07-27 03:34:57 +02:00
tsm-odoo 901a43f532 [IMP] bus, *: improve multi tab service
*: calendar, im_livechat, survey.

Following @ged-odoo review, the multi tab service has been improved:
    - multi_tab_service.js has been moved to the correct location.
    - _callLocalStorage method has been removed and replaced by
      getItemFromLocalStorage/setItemToLocalStorage.
    - underscore.js calls have been removed.
    - multi_tab_service is now using function closure style  instead of class.
    - multi_tab service is now using its own bus instance.
    - service name is now in snake case as per convention.
    - tests have been added.
    - multi tab service now handles setting/removing/getting values
      shared between  all the tabs.

closes odoo/odoo#96386

Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 03:34:51 +02:00
Noe Antoine dc920a552c [IMP] website_slides: reword article edition message to match new edit
Adapt the wording since the edit button is not always on the top
right corner but can also be on the top left one. Also make the
info alert non editable, and add a placeholder to indicate the
editable area.

Task-2924229

closes odoo/odoo#96371

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-07-27 02:18:32 +02:00
luvi 148c915ed2 [REF] web: remove unnecessary component
The purpose of this component was not helpfull
as it has no real use case and was only used
by the BinaryField component.

Instead of using an entire component, we only
keep the DOM that is now used directly in the
BinaryField template.

closes odoo/odoo#96357

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-27 02:18:29 +02:00
luvi 0d8e4495c0 [FIX] web: upload files with Many2ManyBinaryField
This commit fixes the wrong implementation of the
field. It was not functional and is now using the
FileInput component.

Before the commit, it was not possible to upload or
delete files from the list. Test has been adapted to
those changes.

Toast notifications were also missing, and a new
test has been added to check that a notification is
correctly displayed when the server responds with a
error message for a given file.

Part-of: odoo/odoo#96357
2022-07-27 02:18:29 +02:00
filwu8 ce12dbbd8c [CLA] Individual signature Gordon.md
[CLA] Individual signature Gordon.md

closes odoo/odoo#96278

X-original-commit: 9bfad543744549fccb305fc9fb99bb9e701bfe49
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-07-27 02:18:25 +02:00
Sébastien Theys b401ba6e2d [IMP] mail, *: remove legacy code from activity systray
* = calendar, crm, im_livechat, mass_mailing_sms, note, test_discuss_full,
    test_mail

task-2920645

closes odoo/odoo#96114

Related: odoo/enterprise#29794
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 02:18:15 +02:00
Benoit Socias 0099b8ee36 [FIX] web_editor: filter inline styles when changing media type
Since [1] and even after [2] when replacing a media by a media of a
different type only classes were cleaned - but all inline styles were
copied.

This commit filters the inline styles when replacing a media by a media
of another type.

Steps to reproduce:
- Drop a "Text - Image".
- Replace the image by an icon.
- Apply solid colors for the foreground and the background.
- Replace the icon by an image.
=> The applied colors were kept in the inline style of the image.

[1]: https://github.com/odoo/odoo/commit/7fd0698cf765a79959566b51e33cb76bff83d344
[2]: https://github.com/odoo/odoo/commit/9ca349bbdb75505e8dbd31898f05ba8d694e7953

task-2687506

closes odoo/odoo#95853

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-07-27 02:18:13 +02:00
Benoit Socias cc6e888362 [FIX] web_editor: keep classes that exist in both source & target media
Since [1] when replacing a media by a media of the same type or that has
some extra classes in common, those classes were removed instead of
being kept.

This commit makes sure only the classes that do not exist in the newly
selected media type are removed.

Steps to reproduce:
- Drop a "Text - Image".
- Replace the image by an icon.
- Apply a circle effect and colors on the icon.
- Replace the icon by another icon.
=> The applied effect and colors were lost.

[1]: https://github.com/odoo/odoo/commit/9ca349bbdb75505e8dbd31898f05ba8d694e7953

task-2687506

Part-of: odoo/odoo#95853
2022-07-27 02:18:12 +02:00
Thanh Dodeur 0efcb55c6f [REF] use ChannelMember in CallParticipantCard model
part of task-2692836

closes odoo/odoo#95418

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-27 02:18:09 +02:00
Arthur Detroux (ard) a396f791da [FIX] website, web_editor: fix header and footer page options
Commit [1] moved the editor in the backend introducing changes to the
way some options interact with the website. This unfortunately broke
the header position option, the header background option and the footer
visibility option.

The header position option would loop indefinitely, the header
background color option would not display the correct preview colors and
the footer position would trigger a traceback.

This commit fix those bugs:

- The header position option had a callback that was never called, it is
  now called.
- The copy of styles introduced by [2] is now less implicit. Only styles
  that are defined in web_editor/common/utils:
  [EDITOR_COLOR_CSS_VARIABLES] are copied on the snippet menu, and only
  those variables will be used as background colors for the preview
  elements. (Allowing for every other colors like black and white to be
  used with classes).
- The footer visibility option had a broken line of code that was copied
  from past code. It is now fixed and working.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6

task-2687506

closes odoo/odoo#94949

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-07-27 02:18:06 +02:00
Benjamin Vray 9fe6d82deb [FIX] website: fix "over the content" option not saved
Since this commit [1], when you select the Header position option and
set it to "Over The Content", the change is not saved if you did not
edit something else in the page too.

Indeed, now that the "save" works correctly (and that it no longer saves
the page every time). It does not detect the change made by this option
which is to add a class on the '#wrapwrap' element. (The editor looks
for changes inside the wrapwrap but not on it).

This commit checks if any page option is dirty on save on top of
checking if the content of the page has been modified.

Additionally, this commit fixes a bug that would occur on Firefox based
browsers where the hidden input used to display the status of these
options would be auto-completed by the browser in some conditions.
(https://bugzilla.mozilla.org/show_bug.cgi?id=520561).
This could result in an incorrect state being displayed.
To reproduce:
  - Change the option, click on cancel, start the editor
  - the incorrect state is displayed

A test is also added by this commit to verify that all the page options
works correctly.

[1]: https://github.com/odoo/odoo/commit/bab673488e185ddd7792aedecc3870663290fed3

task-2871426

X-original-commit: ea7a69b344d970cc2b31555f4cd8fd7c5e2fc6d2
Part-of: odoo/odoo#94949
2022-07-27 02:18:05 +02:00
Mathieu Duckerts-Antoine 57be371457 [FIX] web: search panel: use action context when fetching data
In SearchModel, the calls to search_panel_select_range and
search_panel_select_multi_range were done without using the global
context (e.g. the action context), contrarily to what is done in the
legacy SearchPanelModelExtension. We fix that.

closes odoo/odoo#96458

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-26 20:46:47 +02:00
Jigar Patel d132421180 [FIX] web: restore .text-body class
During the BS5 migration, the .text-body class wasn't properly ported.

As it is a standard Bootstrap class and useful to override component's color with the one used by the body (ie. set a heading color the same as the content).

This commit restores it.

closes odoo/odoo#96173

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-26 18:44:52 +02:00
Adrien Widart 8482fb8a92 [FIX] stock: avoid putaway rules application with extra-SM
When receiving more than expected, we try to redirect the SM thanks to
the putaway rules. This can lead to undesirable behaviors.

To reproduce the issue:
1. In Settings, enable 'Storage Locations'
2. Create a storable product P
3. Edit the operation type "Receipt":
    - Show Detailed Operations: True
4. Create and confirm a planned receipt for 1 x P
5. In the Detailed Operations:
    - Set the done quantity to 3
    - Set the destination location to Shelf 1
6. Validate the receipt

Error: The destination location of the SML has changed: Stock. It should
still be Shelf 1

When validating the SM, because the done quantity is more than the
demand, an exra-move is created. During such a process, the extra move
is confirmed and assigned, so it leads to the destination redirection
thanks to the putaway rules (that's the reason why the destination Stock
will be selected and defined on the SML).

In such situation, we should not try to apply the putaway rules.

OPW-2900283

closes odoo/odoo#96124

X-original-commit: 0183298293192538a801f52262c047ea34a1b76a
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-07-26 18:44:49 +02:00
Antoine Vandevenne (anv) b7181334a9 [REF] payment: reuse the transaction status template wherever possible
The alert block content and style for the transaction status after
payment were computed in two different places: In the dedicated
`payment.transaction_status` QWeb template, and in the
/payment/confirmation` route's controller which, for some reason, was
re-inventing the wheel instead of relying on the dedicated template.
This commit combines the slightly different behaviors in the template
and gets rid of the duplicated logic in the controller to:
- Handle the states 'draft' and 'error'.
- Always show the transaction's state message, and not only when the
  transaction was in a state for which there exists no pre-defined
  message (`draft` and `error`).

task-2924873

closes odoo/odoo#96348

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 15:48:53 +02:00
Romain Derie 985e49bdb5 [FIX] website: remove Google Analytics dashboard (deprecated)
==== Short version ====

Google is deprecating Universal Analytics in July 2023 and Google
Sign-In in March 2023. Google Analytics Embed API is based on Sign-In,
meaning it won't work anymore. It actually already doesn't work anymore
for accounts created somewhere after mid-2020 apparently.
There is no plan for now for Google to allow Analytics 4 dashboard to be
embed in external website.
We therefore can't do anything to keep the Google Analytics dashboard in
Odoo.
In previous stable version, it was kept but is displaying a warning
about it (as until mid 2023 old accounts can still embed it).
All this is about the embed dashboard, not the tracking in itself for
which Odoo is already adapted in Odoo 15.0 for Analytics 4.

==== Detailed version (following short version, read it first)  ====

- Universal Analytics EOL July 2023, see [1].
- It will be replaced by Analytics 4 for which Odoo is already ready and
  actually using it since version 15.0 with [2].
- Google Sign-In EOL March 2023, see [3]. Analytics Embed API was based
  on it, it won't work anymore.
- There is no plan (for now) for Google to allow Analytics 4 to be able
  to be embed in external websites. They seem to just have dropped the
  "feature".
  This was confirmed by Google here [4] and indirectly here [5] in the
  DOC:
  `Note: This API does not support Google Analytics 4 (GA4) properties`
- While the EOL is planed for 2023, the dashboard integration is already
  not working anymore for new accounts.
- Old projects/keys/accounts can still embed their analytics dashboard.
  The threshold seems to be somewhere mid-2020, according to [6].
  It seems to be accurate as my own key from 2018 still works, while my
  keys from 2021 do not.

==== Fix ====

- In stable, warn user about it in their Odoo Analytics dashboard (this
  PR) and also add a warning about that on the doc.
- In master, simply drop the whole google analytics dashboard
  integration and remove the doc about it, see [7].

==== Useful links ====

[1]: https://support.google.com/analytics/answer/11583528?hl=en
[2]: https://github.com/odoo/odoo/commit/78bc86cbeccfc5df16218aee2b0d7c501e5c05b5
[3]: https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html
[4]: https://issuetracker.google.com/issues/233738709?pli=1
[5]: https://developers.google.com/analytics/devguides/reporting/embed/v1
[6]: https://support.google.com/analytics/answer/11583832
[7]: https://www.odoo.com/documentation/15.0/applications/websites/website/optimize/google_analytics_dashboard.html

Finally, note that it means that from July 2023 to Octobre 2023, while
Odoo 14.0 is still supported, Google Analytics won't work anymore in
that version as it will still be designed for Universal Analytics and
not Analytics 4.

opw-2710910
opw-2855405
opw-2881515
opw-2892370
task-2790245
task-2820890

closes odoo/odoo#96280

X-original-commit: d065595f77790fb5ab9480f6de5b88549352324b
Related: odoo/enterprise#29666
Related: odoo/upgrade#3698
Related: odoo/documentation#2499
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-07-26 15:48:43 +02:00
Donnie 91d0e9c645 [IMP] website_sale: exclude the excluded variants from attribute search
Filter product templates search result if there are any possible attribute
combination to get/create a product variant regarding the searched attributes.

For example if the combination (A, B) is excluded, filtering on (A, B)
will filter that product out of the result.

task-2558970

closes odoo/odoo#89018

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-26 13:25:05 +02:00
Horacio Tellez c1aa010af7 [IMP] payment: filter out acquirers based on the amount
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.

While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.

Task - 2162165

closes odoo/odoo#82411

Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 13:24:57 +02:00
momegahed 70bcc7926e [FIX] point_of_sale: res.partner doesn't belong to a specific company
Steps to reproduce:

1- install POS in multicompany env
2- create a customer c from POS UI
3- c doesn't belong to the active company

Bug:
the company_id is not set when the customer is created

Fix:
set comapny_id to current active company for new customers created from
POS

OPW-2881551

closes odoo/odoo#96073

X-original-commit: 3aa03eb65d431cb9749a2b31a9a09d6b41cd34a4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2022-07-25 21:23:51 +02:00
Thanh Dodeur 174ff9ff83 [REF] mail: use the channelMember relation for RtcSession
part of task-2692836

closes odoo/odoo#96394

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-25 20:12:42 +02:00
Lucas Perais 03bd13e4c0 [FIX] web: legacy list switches view to form with the right resIds
Have a legacy list view, click on a record to open it in a new (WOWL) form view
Before this commit, the pager was wrong, as we never passed the list's current resIds
to the form.

After this commit, the pager of the wowl form view is correct.

closes odoo/odoo#96123

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-07-25 20:12:38 +02:00
Antoine Guenet afea90e98a [FIX] mass_mailing: use mass_mailing.wysiwyg also for plain text
The "plain text" template instantiated the regular web_editor.wysiwyg
rather than its specific override for mass_mailing. As a result, it
didn't include certain customizations like commands that should be
overridden for mass_mailing.

task-2715295

closes odoo/odoo#94434

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-25 17:45:07 +02:00
Antoine Guenet b45ac038fe [ADD] web_editor, web: add signature command to PowerBox
This adds a command to the PowerBox to insert the user's e-mail
signature into the editable document.

task-2715295

Part-of: odoo/odoo#94434
2022-07-25 17:45:07 +02:00
Samuel Degueldre 57d97752a2 [FIX] web: use color-contrast instead of color-yiq
Previously, we were using the bootstrap 4 function "color-yiq" to choose
a text color depending on the background color. Since the migration to
BS5, color-yiq is no longer valid, and color-contrast should be used
instead, but the wowl-views migration was maintained in parallel from
the BS5 migration and some instance of this function call were added
back with it. This commit fixes those.

Functionally, this fixes the text color in the m2m_tags field.

closes odoo/odoo#96598

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-25 16:34:10 +02:00
Samuel Degueldre 19d0a92b2c [REF] web: remove useless statusbar css rules from form view css
These rules no longer apply because they use a direct descendant
selector which no longer matches since field widgets now have an extra
div. These rules also already exist in the statusbar_field.scss file.

Part-of: odoo/odoo#96598
2022-07-25 16:34:09 +02:00
Samuel Degueldre 4c2dff9205 [FIX] web: fix enterprise badge in settings being hidden and wrong color
After the bootstrap migration, the enterprise badge in the settings view
were the wrong color because the class bg-primary was not adapted. This
commit fixes that.

After the wowl views merge, the badge has become hidden behind the
navbar, because it can no longer modify the DOM of its label as it is
managed by owl. When there is no label, the widget appends the badge to
its own $el, and uses position: absolute to position it. This didn't
work because the closest parent that was positioned was the view itself.
This commit fixes that by giving a position: relative to the settings
box.

closes odoo/odoo#96580

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-25 16:34:01 +02:00
Samuel Degueldre e9b9f6520f [REF] web: move settings css rules to the correct file
The css rules for the settings view should be in the corresponding css
file, not with the generic form view rules. This commit moves these
rules to the proper files and unnests some rules when the selectors are
specific enough, which generates less CSS.

Part-of: odoo/odoo#96580
2022-07-25 16:34:01 +02:00
David Monjoie a5046ab1da [FIX] web_editor: properly paste newlines on Windows
Windows uses /r/n as newlines and the split parameter was not taking
that into account, thus inserting the /r character.

task-2742071

closes odoo/odoo#96422

X-original-commit: 90e565f811523968c297f0254f4aa7046c4e710e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-25 16:33:53 +02:00
FrancoisGe 263bef0737 [FIX] web: ListView use the correct label
This commit solves 2 problems in the list view:
- incorrect label for a column
- the label in the optional column dropdown can be different than
  the label of the displayed column

When converting the list view, we used the displayName of the widget
and not its label.

In order to improve the consistency between the labels in the optional
column dropdown and the associated columns, we decided to use the same
label.

closes odoo/odoo#96408

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-25 16:33:49 +02:00
Radhika Shyara f65ae53fb2 [FIX] mail: fix the follower subtypes order
Before this commit, the subtypes are not correctly ordered when
none of the subtypes have a parent model. while it should be
order by parent model, then by sequence.

So in this commit, we will first check if both their parent model
are falsy then we can't order them (A = B). Then we will consider
their sequence, and they will be useful to determine the proper order.

task-2904015

closes odoo/odoo#96402

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-25 16:33:46 +02:00
Ahmad Khanalizadeh 08138a3322 [FIX] point_of_sale: avoid rounding error when merging order lines
Before this commit when multiple instances of the same product
were selected in a PoS session, `can_be_merged_with` checked if they
had the same price before merging them in a single order line. However
the order line prices were not rounded. In the case of a floating
point error in order line price calculation, this behavior resulted
in multiple order lines for the same product.

Steps to reproduce the issue:
1. Create a product
2. In the pricelist, create a formula of -10% discount based on cost,
and set the cost as 136.35 $
3. Open a POS session, add the product multiple times
4. The products are not combined in one group, each creates their
own order line

To fix this issue, we need to round the order line prices in this
function.

opw-2854304

closes odoo/odoo#96410

X-original-commit: 254521d302b31acd5b6f6cfbf49c184035b30eb0
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-25 12:39:57 +02:00
root 8b62d124bf [FIX] point_of_sale: allow overriding mail values
closes odoo/odoo#96407

X-original-commit: 7a884b5cd46d943ed52e8c5aac2406010b013411
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-25 12:39:54 +02:00
Aurélien Warnon 2160315869 [FIX] tools: fix profiler datetime usage
This commit fixes the profiler datetime usage by properly using the
'real_datetime_now' as a callable.

This was breaking the output json file when profiling.

closes odoo/odoo#96456

X-original-commit: 5fec27e42b033f79933afb3d0c85b142360981f9
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-07-25 07:51:02 +02:00
Josse Colpaert 3b59b26967 [FIX] l10n_it_edi: Natura field in DatiRiepilogo should be after AliquotaIVA
It was moved by accident in
https://github.com/odoo-dev/odoo/commit/fc211bb65926fe6ab4e11d0f550258235dc029eb#diff-811190e17a6319ef140e8c723545eec04db37d3cad73a7c855f0808aa74131d1

FatturaPA is quite picky in terms of the order of fieldS.

opw-2703669

closes odoo/odoo#96564

X-original-commit: a0e9cac4900e38bfc534495dbb1e5b8b3a9cce5b
Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-22 18:54:08 +02:00
Panagiotis Kyriakou 4b34897416 [IMP] project: add access info on project visibility settings
This commit introduces some information/instructions regarding the access
to the project/tasks depending on what the user has selected for the project visibility.
This should reduce confusion and thus increase productivity on the user side by
making the task of granting access rights more straightforward to the user.

closes odoo/odoo#95947

Task: 2917471
Related: odoo/enterprise#29455
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-07-22 18:53:52 +02:00
Hugo Adan 3e0230ead3 [REF] purchase_stock: Split _get_quantity_in_progress method in order to make it more inheritable
closes odoo/odoo#96555

X-original-commit: cb9314e902fc899c5ab42b6fd4d8c1ed811c24e7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-07-22 17:38:52 +02:00
odoo 3d7247ad4d [FIX] mrp: don't miscount child/parent MOs in 2/3 Step Production
Steps to reproduce the bug:
- Enable 'Multi-Step Routes' option in Inventory settings
- Edit warehouse and update Manufacture = 'Pick components, manufacture and then store products (3 steps)'
- Create a storable product 'P1' with BOM:
    - BOM type: Manufacture this product
    - operations: “OP1”
    - Components: product 'C1' consumed in the operation 'OP1'
- Set Reordering rules for product 'P1'
- Run Scheduler and MO will be generated with order points
- Edit MO and add Producing Quantity less than to produce
- Validate the MO and create backorder.

Current behaviour:
- child/parent MO were getting visible when backorder was created in 2/3 Step Production.

Expected behaviour:
- No child/parent MO visible until child/parent relations are there

closes odoo/odoo#96533

Task: 2846768
X-original-commit: 14431b2497dcf4aaf778ef1b06e023101b00a4e2
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-07-22 16:22:06 +02:00
Abdelouahab (abla) d86ed180a6 [FIX] web : fix bg for bold document layout
To reproduce
============

on settings -> document layout -> choose Bold with blank background.
print a document (quotation for example) that has at least 2 pages.
the second page of the document has a background.

Purpose
=======

the issue is caused by the condition :
https://github.com/odoo/odoo/blob/0436709f33e57479bd6d62c2e0a2de74743cbaa4/addons/web/views/report_templates.xml#L403
where we don't take into account the case where no background is set.

Specification
=============

to solve the issue the condition was corrected

opw-2888650

closes odoo/odoo#96528

X-original-commit: bf2ce0aa0c7d45c90d7ff104d5af5f99b29d59ae
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2022-07-22 16:22:02 +02:00
Younn Olivier 16c99f58ba [FIX] website: fix restricted editor warnings
Before this commit, the "Edit Menu" was displayed for the restricted
editors, even if they didn't have the right to access the website pages.
This was leading to a warning in the "click_all" test with the demo
user, and didn't make sense for the real user (who was prompted an
"access denied" modal).

Now, this menu is displayed only for the website designers.

Additionally to that, the website root instance would load the wysiwyg
assets if it is created inside an iframe which has the "load-wysiwyg"
data-attribute. But the test was not correctly written (as
data-load-wysiwyg was the string 'false'). This would lead to a warning
in the console when a user with no website rights was accessing the
website client action, introduced in [1].

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#96520

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-07-22 16:21:59 +02:00
Abdelouahab (abla) a9f409c87d [FIX] website : one2many fields when no record is found
To reproduce
============

1) Website Fronteed > Add a page
2) Drag the form block
4) Add a field
5) for the field type select a one2many field (Reactions for example)

an error will be raised.

Purpose
=======

the issue is caused by the condition :
https://github.com/odoo/odoo/blob/bec7d16eb4f4e8b27093ac73cb4e638456c516ef/addons/website/static/src/xml/website_form_editor.xml#L331

where `field.records` is an empty array but `![]` is `false` in Javascript, so we will end up with a field without an input
then the `querySelector` in this line :
https://github.com/odoo/odoo/blob/44fa95f52eedf9e20b11ffe20209fae499446fe1/addons/website/static/src/snippets/s_website_form/options.js#L1363

will return `null` and trying to get `name` from `null` will occure the error.

Specification
=============

to solve the issue the condition was corrected and some code was moved for styling reasons.

the Selection Field was also changed because it looked the same as One2Many field.

opw-2916396

closes odoo/odoo#96485

X-original-commit: 2c3b76c39ba65952308164b3f049c4e275364e61
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-07-22 16:21:55 +02:00
+3 4274a0dad9 [MERGE] *: enable owl list and form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

closes odoo/odoo#78221

Related: odoo/enterprise#23069
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:46 +02:00
Sébastien Theys 28200c5ad5 [IMP] mail, web: adapt chatter container in new form
task-2871070

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
+2 bc0a0cead6 [IMP] web,*: enable owl list & form views
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.

We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).

[1] odoo/odoo#92475

Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
2022-07-22 16:21:45 +02:00
Jorge Pinna Puissant 6994ccb31f [IMP] web: BasicModel: improve the performance of context eval
Before this commit, the evaluation of the context was done for all
the context, even when only a subset of the context was needed.

Now, we evaluate only the attributes of the context that are used.

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
Géry Debongnie 5329b9a9ae [IMP] web: prevent toPyDict from iterating on keys
The `toPyDict` method is used to transform an object into a "python" dictionary,
by returning an equivalent object with the PY_DICT object in the prototype chain.
In practice, it is called everytime we create an evaluation context.

This is a performance problem, since creating the context is not cheap in the
case of Odoo form views: we need to iterate on all the values of the current
record, checking for each changes, applying all relational operations, ...
And even worse, almost all of the domains that we need to evaluate have very
simple conditions, which just needs to check the value of one field. So, it is
useful to make the computation of the eval context keys lazy, and this commit
make sure that pyjs does not undo the lazyness of the eval context, if any.

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
Mathieu Duckerts-Antoine c5a8c4414c [FIX] web: load legacy x2many subviews
In a view form, legacy x2many fields with no view inline would not have
their subviews loaded. We fix that.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
Mathieu Duckerts-Antoine 1d61d68207 [FIX] web: processing of field mode attribute
The view mode in which to display a legacy x2many field in a new form
view was badly processed. This lead those fields to be not renderered at
all (no list or kanban renderer displayed) or be renderered with the
wrong renderer in mobile mode. We fix that.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
Mathieu Duckerts-Antoine 182b241e7d [IMP] web: support of fieldDependencies
Sometimes a field component might need to know some other fields values
to render itself or for other purposes. In legacy, a mechanism allowing
to load some field values not displayed was available: a field would
declare a fieldDependencies object specifying some field names and
their types and the related values would be loaded along the other data.

Here we introduce the same mechanism for the new views.

Note that in a new view list, the tag widget is not currently supported
so that we have remove some lines in the list arch parser that were
useless.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00
FrancoisGe ce61a35cf8 [FIX] web: crash when an arch as tree inside another tree
Before this commit, if an arch contained a tree which itself contained
a tree, the parser would crash.

The reason for this crash is that the parser was trying to parse the
second tree with the model of the first. So it didn't know the fields.

The solution is to stop the exploration of children when it is not
necessary. For example, for fields, it is not necessary to explore
the children, it is parseFieldNode that takes care of it.

Part-of: odoo/odoo#78221
2022-07-22 16:21:44 +02:00