Commit Graph
147063 Commits
Author SHA1 Message Date
Nicolas Bayet 0076f4b491 [FIX] web_editor: prevent focus when editor is not loaded
It is possible that the wysiwyg focus method is called before the
odooEditor being loaded. This commit insure that the odooEditor
properly being loaded.

Task-2704538

closes odoo/odoo#81114

X-original-commit: 33782020906988322598c4a3e61b8a6b16970aa0
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-09 12:55:50 +00:00
Nicolas Bayet ea5fc6933d [FIX] web_editor: fix unlink when nested tag
Whenever there was a tag inside a link
(e.g.`<a href="..."><b>link</b></a>`), it was impossible to unlink.

closes odoo/odoo#81112

X-original-commit: a7f2027c6131309b239026b4e1299a6f396171dd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-09 12:55:46 +00:00
Sébastien Theys 67ea2463bc [FIX] mail: remove obsolete _computeRingingThreads
Oversight of https://github.com/odoo/odoo/pull/81017

closes odoo/odoo#81125

X-original-commit: f1fe1724e70301b5bca62f3ae355760c2c3fbf41
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-09 12:05:09 +00:00
Martin Trigaux 4226b3b4d0 [FIX] web_editor: use helper
A designer may not have access to ir.model.fields, use the fields_get
helper instead

Fixes odoo/odoo#80948

closes odoo/odoo#81123

X-original-commit: 826100a5b5ecaf62dfe6870bf5ad48a37cd2d7f7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-09 12:05:03 +00:00
FrancoisGe 930a36a56b [REF] web: remove noFields in makeView
The purpose of this commit is to simplify the makeView api by removing
the noFields option.

Only two tests used it:
For the test "'resModel' must be passed as prop", the noFields option
was useless. So we can remove it.

For the test "'arch' cannot be passed as prop alone", it is not
necessary to use makeView. So we will replace it.

closes odoo/odoo#81119

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-09 12:04:59 +00:00
Anh Thao Pham (pta) a1508eddc9 [FIX] point_of_sale, l10n_fr_pos_cert: allow to close session after 24h
- Use a company located in France
- Install point_of_sale and l10n_fr_pos_cert
- Open a POS session
- Make some orders
- Quit session without closing it (Keep session open)
- Come back more than 24 hours later
- Try to open the session (Continue selling)
An UserError is triggered with the following message:
"This session has been opened another day. To comply with the French law,
you should close sessions on a daily basis.
Please close session POS/00007 and open a new one."

However, it is not possible to close the session as the closing control
is managed in the fontend inside the session.
Therefore the POS is stuck as we cannot close the last session, neither open
a new one.

This fix allows an user with the rights to close a session to connect to
the stuck session to close it.
He will only have access to the closing control popup, without the possibility
to continue selling.

opw-2696823

closes odoo/odoo#81110

X-original-commit: 8f14fef9232609b0a6fe3d71606f3d2b016100bb
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-12-09 11:16:56 +00:00
roen-odoo 944e442b68 [FIX] pos_coupon, pos_restaurant : Promotion program
Current behavior :
When you add a promotion campagn to a PoS the promotion is applied
on every line of every order everytime you load the order. This cause situations
where you have multiple discount for a single product.

Steps to reproduce:
- create a standrard promotion program (automatically applied, 10%)
- set that promotion on the PoS (bar)
- open a session, chooses a table and make an order --> promotion correctly applied
- get out of the table and go back to the same table --> 2 additional lines are created because of the promotion

opw-2699544

closes odoo/odoo#81096

X-original-commit: 72d6431eb26654b697fc0379f4b6d7e305bb79fc
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-12-09 10:27:02 +00:00
Brice bib Bartoletti 986b11c21f [FIX]account:reverse move condtnly hide btn and radio button
Aim of this commit:
- Hide the disabled radio button on reversal wizard when it's disabled.
(invoice residual_amount is 0)

before this commit:
- The radio buttons in the reversal wizard are visible even when it's
disabled.

after this commit:
- Radio buttons are hidden when it's disabled.

task/ticket:#2603144

closes odoo/odoo#81089

X-original-commit: e860a346ba6d7831674685817eed006dac86b264
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti <bib@odoo.com>
2021-12-09 10:26:58 +00:00
Laurent Smet 0cd014e1e9 [FIX] account: Add tax_repartition_line_id in tax details
closes odoo/odoo#81103

X-original-commit: 8dcfdf0f860246970ef375dfff755cbd2efcf697
Related: odoo/enterprise#22789
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-09 08:09:35 +00:00
Thibault Delavallée 48e92ac956 [FIX] website_event_questions: fix propagation from template
A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field ``use_questions``.

As most templates use automated email this was not seen before.

Task-2703285 (event performance)
Task-2703289 (event testing)

closes odoo/odoo#81098

X-original-commit: 10732e077d4bfc296ca59a9c3df613b9fd1cb275
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-09 07:23:20 +00:00
Joseph Caburnay b157c99d4a [FIX] pos_hr: cash opening is not triggered when logged in by scan
When logging in as employee using barcode scanner, the event to
show the opening cash control is not triggered, therefore, only the
first user to login using the selection popup that the cash opening
will be initiated. We fix this issue by lifting the event trigger
at the `back` method.

closes odoo/odoo#81085

X-original-commit: 992a0130ea802814279c62f28880ab2120d1ad3c
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-12-08 17:21:56 +00:00
Arnaud Baes 256264a999 [FIX] survey: Report style declaration
It seems the `.scss` weren't recognized when loaded via the bundle
`report_assets_pdf` when rendering certifications

p/feedback report

closes odoo/odoo#81081

X-original-commit: 925ee95b02b51e156b0848161f7716b982e47235
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-08 16:28:57 +00:00
John Laterre (jol) be762c8dd4 [FIX] l10n_nl_edi: fix traceback when posting an invoice
Steps to reproduce the error:

- Create a new company, set Netherlands as country and fill in the required info (street, zip, city, vat, kvk-number).
- Set a bank account on the company contact.
- Install NL chart of account on this company (Netherlands Accounting package).
- Create a test customer, and don't set any address or set a country not listed in EAS (https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/).
- Create an invoice for this test customer and try to post it.

Before this commit, if a Dutch company had tried to create an invoice for a customer from a country not listed in the Electronic Address Scheme (EAS) codes, Odoo would have given them a traceback error.

Now the code checks if the customer is from an EAS country: if they are, the code renders the bis3 invoice template, if not a UserError is thrown explaining the problem.

closes odoo/odoo#81080

X-original-commit: b637a333450911002af3b755cd1450e9efdef9e4
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre <jol@odoo.com>
2021-12-08 16:28:53 +00:00
Thibault Delavallée 76bf909c15 [FIX] website: correctly override _render
Oversight of odoo/odoo@aceb086854

closes odoo/odoo#81079

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-08 16:28:49 +00:00
Sébastien Theys e1d3815348 [FIX] mail: avoid costly debug operations
These errors should not happen in production, it is only helpful for debugging.

The opportunity is taken to limit our debug code to a messaging specific debug,
as debug '1' is used in production to see extra features, and debug 'assets' is
necessary to get decent stack trace.

The easiest way to enable this debug mode at the time of this commit is to
either manually set the value to true in the code, or to type the following line
in the browser console if editing the code is not an option:
`odoo.__DEBUG__.messaging.modelManager.isDebug = true;`

Part of task-2702450

closes odoo/odoo#81075

X-original-commit: f9ae7510c8adaa83379b90f798ee535ede99be25
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-08 16:28:45 +00:00
Daniel Blanco bdb9ae8648 [FIX] l10n_cl: fixx the sum for the subtotal in the invoice lines
closes odoo/odoo#80697

X-original-commit: f90d59cae43f170f2f0a76f96d41e5a99c9d2083
Signed-off-by: Josse Colpaert <jco@odoo.com>
2021-12-08 16:28:41 +00:00
Thibault Delavallée 7ef380fe34 [IMP] event: add precompute to remove create hook
On event model, seats_limited and date_tz are required but are editable stored
fields. An override of create has been added to ensure they have a value as
compute are called after creation which leads to required not being satisfied.

Now that precompute [1] is available this code can be safely replaced.

Performance tests (not yet merged [2]) indicate this has no impact on queries.
What was done manually before this commit is now done directly by the ORM.

[1] odoo/odoo@d04a5b5c8c
[2] odoo/odoo#81068

Task-2702872 (Event precompute)

closes odoo/odoo#80672

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-12-08 15:36:51 +00:00
Thibault Delavallée 2ac230b25b [FIX] website_event_questions: fix propagation from template
A wrong field is used to control propagation of questions from event template
to child events. Currently an event template must use automated emails to
propagate its questions, instead of correctly checking the question enabled
field use_questions.

As most templates use automated email this was not seen before.

Task-2702872 (Event precompute)

Part-of: odoo/odoo#80672
2021-12-08 15:36:50 +00:00
Adrien Widart 2cc6ca6dd2 [FIX] purchase: compute the average of the delays in report
When consulting the Purchase Analysis, the measure "Days to Confirm" may
not be easily understandable

To reproduce the issue:
1. Create a purchase order PO:
    - Order Deadline: <today + 10 days>
    - Add 2 products
2. Confirm PO
3. Purchase > Reporting:
    - Measures: Days to Confirm
    - Group By: Order

Error: For PO, the value of "Days to Confirm" is -20, it should be -10

The report computes the sum of the delay (i.e., "Days to Confirm") of
each purchase order line. Computing an average seems more relevant

A similar flow could be reproduce with the measure "Days to Receive"
(i.e., the difference between the Order Deadline and the Receipt Date)

OPW-2678673

closes odoo/odoo#81053

X-original-commit: da3fa1f8887e06e7a86e761ef844f79cc0d06e6f
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-12-08 14:31:44 +00:00
Pierrot (prro) b8d2663790 [FIX] website_sale: translate Pay Now and Confirm Order
How to reproduce the problem:
- Install the website_sale module and the German language (and
activate it for the website).
- Go to the website, and choose the German language.
- Add a product to your cart and checkout.
=> on the checkout page, the button "Pay Now" is not translated (
"Confirm Order", if the total amount = 0)

These terms are now added for translation.
The terms were incorreclty formatted in the xml and were not
picked up for translation export. Introduced by this commit:
https://github.com/odoo/odoo/commit/573ed74c121c1572b3fab6f9553ed7f93f7b3f99

opw-2686463

closes odoo/odoo#81056

X-original-commit: 166c19d5e9018332a63c1c82dd4268fd1224332b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Roose Pierre-Rodéric ( prro) <prro@odoo.com>
2021-12-08 13:44:33 +00:00
Goffin Simon 5467389393 [FIX] account: Impossible to create account type
Steps to reproduce the bug:

- Go to Accounting>Journals and create new record
- In advanced settings tab, use 'Allowed Account Types' field to create a new one

Bug:

Form for account type does not have required internal_group

Introduced by https://github.com/odoo/odoo/commit/5aeec0c3dcd8aa20293167073f3f4f5cec323b74

opw:2497616

closes odoo/odoo#69455

X-original-commit: bacfea994ce7232af33d7e5525a5b56d5cba5871
Related: odoo/enterprise#22335
Signed-off-by: William André (wan) <wan@odoo.com>
2021-12-08 13:44:26 +00:00
Sébastien Theys e5ac55cc59 [FIX] mail: improve performance of ringing thread
Avoid iterating over all channels every time a new channel is added.

Part of task-2702450

closes odoo/odoo#81051

X-original-commit: 5359a8c354b0a6106d462fe8f047de946614b7b1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-12-08 12:52:32 +00:00
Aaron Bohy c171ebb054 [FIX] web: send correct filter's context when saving filter
Before this commit, the context coming from the action was
merged with the context of the search items to generate the
context of the filter to save, when the user clicked on "Save
current search", whereas it should not.

There is an ActionService test attesting it, but it currently
uses a ListView, which is still legacy, so the new faulty code
wasn't tested.

closes odoo/odoo#81049

X-original-commit: 2d76b33142cf2bf451d4730c035af75c3243da6f
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-12-08 12:52:29 +00:00
Samuel Degueldre bfa7d28a8e [IMP] web: update owl to 1.4.10
Release notes: https://github.com/odoo/owl/releases/tag/v1.4.10

closes odoo/odoo#81048

X-original-commit: 462a58b9938f7601e9696c02d5fd4ded7c75cae0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2021-12-08 12:52:25 +00:00
Hubert Van de Walle (huvw) f2050817d7 [FIX] sale: Add product link in sale.order.line
Steps to follow

  - Click on a product from a sale.order.line
  - The form is switched to edit mode
  -> We can't go to the product page

Cause of the issue

  The quick edit feature was introduced in saas-14.4

Solution

  - remove the 'no_open' attribute from the product

opw-2688863

closes odoo/odoo#81047

X-original-commit: 57d662c4817b83a8f166d11bf35b4b73206704b0
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-12-08 12:52:21 +00:00
Adrien Minet e8c60ad132 [FIX] l10n_in: copying gst treatment from client
How to reproduce:

- Switch to an Indian-based company
- Create a non-Indian customer and set gst treatment
- Create a subscription for the new customer
- Generate an invoice for the subscription
- The gst-treatment field will be empty

Bug:

When creating a new account.move object, the gst treatment is not copied.

closes odoo/odoo#80966

Opw: 2662308
X-original-commit: a1f0ae25f8b96a5ff5691aa0b9ffeb62033932bf
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-08 12:52:18 +00:00
Julien Castiaux 42b522bd83 [FIX] *: cleanup manifest files
*: base_address_city, base_address_extended, bus, crm, im_livechat,
   l10n_ae_pos, lunch, pos_restaurant_adyen, test_assetsbundle,
   test_converter, test_lint.

It is spelled `auto_install`, the `complexity` key is long gone, `qweb`
has been moved to `assets: {'web.assets_qweb': []}`. `js` and `css` are
long gone too, `maintainer` is redundant with `author` which is
"Odoo S.A." by default already, the `certificate` key is long gone.

closes odoo/odoo#80988

Related: odoo/enterprise#22766
Signed-off-by: Julien Castiaux <juc@odoo.com>
2021-12-08 11:17:22 +00:00
Miquel Raïch 70ae1cf628 [FIX] hr: avoid <footer> not found error in view
closes odoo/odoo#80554

X-original-commit: fc5ae487fc178d43c487271d174e27d060b56d1d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:15 +00:00
roen-odoo 341ad3f4dd [FIX] point_of_sale, pos_coupon, pos_hr, pos_restaurant : Check COA not used
Check COA parameter in the open_session_cb was actually never used

opw-2691615

closes odoo/odoo#80410

Related: odoo/enterprise#22522
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:11 +00:00
Sébastien Theys 8be118cf25 [FIX] mail: rename ambiguous get method in model manager
To ease debugging in general, avoid having multiple methods with the same name,
especially in the same file.

This is especially useful when the method name appears in a stack trace, for
example in the performance tool.

Part of task-2702450

closes odoo/odoo#81020

X-original-commit: c3673e63064c7f331754ef0e9d02cbbe7b1927f4
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-08 10:23:55 +00:00
Sébastien Theys 560523e817 [FIX] mail: improve performance of listener removal
Avoid iterating over all listeners that are observing a field, instead store
the fields observed by a listener and access it immediately.

Part of task-2702450

closes odoo/odoo#81019

X-original-commit: bf69834b933c54598bbd82d8fbfcac4a0393c067
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-08 10:23:50 +00:00
Thibault Delavallée 03004aa95d [FIX] sale: do not force order responsible
With recent update to computed fields [1] order responsible is now always
changed to the partner responsible, or its commercial entity responsible.

This cause issues, notably with ACLs 'own documents only'. Indeed a salesperson
could update or set a partner on an order that would change the responsible and
lead to ACLs issues. Moreover some functional flows automatically set a partner
(online registrations, ...) that would make the responsible change without a
clear notification or warning.

We prefer to keep a less intrusive behavior, aka setting a responsible when
no one is set.

Task-2703285 (event performance)
Task-2703289 (event testing)

[1] odoo/odoo@210c9daebc

closes odoo/odoo#81025

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 09:35:08 +00:00
Antoine Guenet e466fdbaf7 [FIX] web_editor: properly convert overflowing row
closes odoo/odoo#80621

X-original-commit: 5a1d94d29004f0f0ddd81c25020a90083d6b8bea
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-08 09:35:04 +00:00
Antoine Guenet 2750bfa97f [IMP] web_editor: no empty class on convert grid
X-original-commit: 731ffadb08961b6aada283f96d82c0a35726cffe
Part-of: odoo/odoo#80621
2021-12-08 09:35:04 +00:00
Antoine Guenet 848fecb003 [FIX] mass_mailing: restore missing space in template class name
mass_mailing_demo has a missing space separating two classes in its
mass_mail_1 template. This restores it.

X-original-commit: a104d4279b0438a05dc4b739fbc4e95e7038e6aa
Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet aceb086854 [FIX] base, web_editor, mail, digest: preserve comments in sent e-mails
For email design in the context of Microsoft Outlook, we want to keep
some magic Microsoft comments (Outlook conditional comment), which -
until this commit - were skipped by QWeb. These allow us to change the
rendering exclusively for Outlook so as to overcome some of its
limitations. This commit introduces a qweb rendering option
(`preserve_comments`) for when - like in mass mailing and digest - we
want to keep comments.

Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet 0ba08b558b [ADD] mail: test for mass_mail mode sending mail with comments
This adds a test sending a mail with comments (MSO conditionals) in
mass_mail mode.

X-original-commit: 8778c10bc1856e57216785a8332b90878ff1b5ef
Part-of: odoo/odoo#80621
2021-12-08 09:35:03 +00:00
Antoine Guenet e4641a8e38 [FIX] web_editor: ensure unstyled tbody in every table on convert inline
This ensures that every `table` element has its contents wrapped in a
`tbody` element, and that that element has its default vertical
alignment replaced with "top" to mimick the grid it's converted from.

X-original-commit: ddf047be9f49ac408c44de26b65ef50be88873b5
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet bd638117ae [FIX] mail: properly make urls absolute in escaped attributes
`_replace_local_links` ensures urls are given as absolute rather
relative paths, for link `href`, img `src` and within styles. This
failed when the style contained escaped single quotes (eg:
`background-image: url(&#34;/my_url/path&#34;);`). This commit adapts the
failing regex appropriately.

X-original-commit: 2af980e8cdc72d35729ef2fbaf5067fe7e72bbb8
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet b7e61e8c32 [ADD] mail: test for _replace_local_links in style urls
This adds a test for the _replace_local_links function of mail render
mixin, in the case of urls in style attributes.

X-original-commit: 199b45c7f6b0155d3828487b2f7771e1500820b1
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 5c69d9e50a [FIX] web_editor: properly size masonry cells
On converting emails for mail client compatibility, masonry showed a few
sizing issues, which are fixed with this commit.

X-original-commit: cfcc498c828b542552b098d6f3a58924abddb091
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 06225d8498 [FIX] web_editor: properly size media list images
When converting a mailing for mail client compatibility, we guarantee a
height for each image. When none can be found, or in the special case of
media_list, that height should however not be forced so the client can
make it take the full height of the cell automatically. This is what is
accomplished by this commit.

X-original-commit: e80433335020a52d8f683060e98047f5ce77b054
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet 9ae5e637e1 [FIX] web_editor: prevent several blocks in one column on convert grid
The following structure is not always properly rendered in mail clients:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

where the h1 and p can be any block-level element.

This prevents that from happening by wrapping each block in a separate
row/column combo like so:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
            </td>
        <tr>
            <td>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

X-original-commit: 01404499277b63dc64a5a26a93bc419cca092440
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet d4b3daa871 [REF] web_editor: import odoo-editor utils into convertInline
Some code from odoo-editor utils is needed in convertInline. In order to
avoid duplication, we need to import that code. To that effect, we can't
have the utils being lazy loaded into mass mailing's iframe while
convertInline is loaded the usual way.
This loads the lightweight utils together with convertInline and turns
convertInline into an odoo-module, which makes it easier to simply
import the utils and delete duplicated code.

X-original-commit: 067c94b009609caa0bd78a75b826247e37557417
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 54a0b8d853 [FIX] web_editor: properly apply table padding to columns
When converting bootstrap grids into tables, we have to move the
containers' paddings into the cells, otherwise they would not render
properly in all mail clients. Before this fix, verical padding was moved
to each cell, which is wrong: it should be applied to the first (top)
and last cell (bottom) only, which it now is.

X-original-commit: 43112d417f70ac0086fbed2a704f208530d31f87
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 23df5ab4ed [FIX] web_editor: keep div inline styles on convert to table
When converting a div to a table, we apply some styles to undo the
table's default styles. This makes sure these styles don't override any
inline styles the div might have been holding.

X-original-commit: 0fad86b330a0e1a3228bbbe76fd2b7370cff3eb0
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Adrien Widart b0278a0221 [FIX] sale_mrp: not include consu components in kit's COGS
When selling a storable kits, the consumable components should be
ignored in account lines

To reproduce the issue:
(Need account_accountant,sale_management,mrp)
1. Create a product category PC:
    - Costing Method: FIFO
    - Inventory Valuation: Automated
2. Create 3 products P_kit, P_compo01, P_compo02
    - P_kit:
        - Type: Storable
        - Category: PC
    - P_compo01
        - Type: Storable
        - Category: PC
        - Cost: 5
    - P_compo02:
        - Type: Consumable
        - Category: PC
        - Cost: 6
3. Update P_compo02's on hand qty: 1
4. Create a bill of materials:
    - Product: P_kit
    - Type: Kit
    - Components:
        - 1 x P_compo01
        - 1 x P_compo02
5. Create & Confirm a sale order SO with 1 x P_kit
6. Process the related delivery
7. Create & Post the related invoice

Error: The journal items of the invoice are incorrect, the value of
Expenses and Stock Interim (Delivered) are $11 instead of $5. The
consumable components should be excluded from this value

OPW-2604084

closes odoo/odoo#81015

X-original-commit: 5de451008552ef9b9c675b34178482d81ff42b89
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-12-08 08:47:01 +00:00
Arnaud Joset b4233a930b [FIX] sale_management: prevent crash when sale order template lines are mixed with rental product
Before this commit, the following traceback would appears when a sale order template was used in rental with rental products.

 ```py
    super()._compute_name()
  File "/home/arj/PycharmProjects/odoo/addons/sale_management/models/sale_order.py", line 187, in _compute_name
    line.name = line.with_context(lang=line.order_id.partner_id.lang).name + line._get_sale_order_line_multiline_description_variants()
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/arj/PycharmProjects/odoo/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'sale.order.template.line' object has no attribute 'order_id'
2021-12-07 14:27:34,267 95502 INFO subscription werkzeug: 127.0.0.1 - - [07/Dec/2021 14:27:34] "POST /web/dataset/call_kw/sale.order.line/onchange HTTP/1.1" 200 - 16 0.009 0.025
 ```

closes odoo/odoo#80979

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 07:57:06 +00:00
Leo Tran b38845c94f [CLA] Viindoo signs Odoo's CLA
closes odoo/odoo#81012

X-original-commit: 567a83806db0e39403edd669940dbe077c04df41
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 20:23:46 +00:00
Joseph Caburnay 123b705677 [FIX] pos_discount: pos app is stuck when changing the discount
To reproduce:
1. Install pos_discount and pos_coupon.
2. Start a session and add item to the order.
3. Add global discount.
4. Change global discount. Stuck.

This is because in some modules, get_orderlines is overridden. Instead
of returning the original object containing the orderlines, it returns
a different array instance containing the lines. This is the reason the
while loop is stuck. With this change, whether get_orderlines return the
container or a copy, we are sure that it won't be stuck in the for loop.

closes odoo/odoo#81011

Task-id: 2697861
X-original-commit: 6d78748794a2db3f324312fc773f7a48fd0ffba4
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-12-07 19:27:40 +00:00