To reproduce:
1. Create a grouped tax with multiple taxes. Reorder the tax
items. (Important step.)
2. Assign tax to the product.
3. Open pos loading the product.
4. a. [BUG] If pos config is tax-included -> non-responsive ui.
4. b. [BUG] If pos config is tax-excluded:
Add the product. -> non-responsive ui.
Fix:
With the new reactivity in owl, mutating reactive objects will
trigger rerender. However, computing tax amount of orderline
or product with grouped taxes result to mutation of a reactive
object, triggering an infinite render (render -> compute with
mutation -> will trigger another render -> ...).
The call to sort is mutating the reactive array referred by
`children_tax_ids`. To prevent this infinite render, the solution
is to use a copy of the array when sorting the taxes.
OPW-2816546
closesodoo/odoo#88245
X-original-commit: b273056a12a34fec75d980e8a4a08ebaedad7e9c
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Inline styles applied by the editor should always have priority over the
general stylesheet. This failed in the case of nested styles (a <font>
with a color within a <span> with a font size for instance).
closesodoo/odoo#88004
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
To give a custom style to a template, we need to add a style element at
its top, with the id "design-element", and apply to it the supported
styles. These supported styles and their selectors can be seen in the
`DEFAULT_CSS_OBJECT` constant in `mass_mailing_snippets.js`.
However, comma-separated selectors were not supported, meaning styles
could only be incomplete.
task-2816655
Part-of: odoo/odoo#88004
The chatter and activity html have the video being sanitized upon
save. As it is a desired behavior, disable the ability to add
video from the editor for those field.
Task-2726483
closesodoo/odoo#88266
X-original-commit: c70d42d12eb522767f84a728c71ac30f66521e2a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Task ID: 2712093
Currently:
- In the payment widget the exchange difference value is always shown as 0 and is described as "Paid on", which can be confusing for a user
Desired:
- The exchange difference should have the difference amount and be described as "Exchange difference" (text-muted)
- In the payment widget pop-up, show the both the amount in company and foreign currencies
closesodoo/odoo#82206
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Because some lines can be sections/notes without a product, and the product
presence when needed is already verified by the sql constraints.
Fixes the mistake from #81818closesodoo/odoo#88244
X-original-commit: fd903101f564b1817f7b5a6aa099f644ef29a527
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
The commands are grouped by command group when rendered by the Powerbox.
That creates a dissociation between the order in which they are rendered
and the order of the arrays in which they are present in the code. The
mechanism to navigate between them with the arrow keys is however
dependent on the latter. As a result we may end up with a visually
disordered navigation.
This adds a private function to reorder these arrays in the same way as
they are rendered, thereby fixing the dissociation.
task-2802749
closesodoo/odoo#87209
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When no command is found in the Powerbox, the text "No results" is
shown, which is annoying. Instead, this hides the Powerbox we such is
the case.
task-2802749
Part-of: odoo/odoo#87209
When using a pricelist with a currency different than the one
of the product, the surcharges, max_margin and min_margin must use
the currency defined in the pricelist.
These tests intends to ensure that this behavior is respected.
This behavior was in fact not present (and a fix was created in stable releases)
in previous releases (before the refactoring 57ced812f0).
To reproduce the issue:
1. Enable multiple currency and enable a second one with an exagerated rate for the sake of clarity.
2. Create a formula pricelist with the newly activated currency using either surcharge or the margin.
3. Create a SO with a standard product. By switching between pricelist, you will see an invalid price.
E.G.:
EUR_rates = 2 compared to USD PRICELIST = surcharge of 10€ on any product
PRODUCT_price = 300$ PRODUCT_price_euros = 150€
CURRENT_SO_price = (300 + 10)/rate_EUR = (300 + 10)/2 = 155€
EXPECTED_SO_price = (300 + 10*rate_EUR)/rate_EUR = (300 + 10*2)/2 = 160€
Solution:
Convert the pricelist item margin & surcharges to the base price currency.
To do so, the needed currency conversion date is given through the context.
opw-2760720
closesodoo/odoo#88243
X-original-commit: 20140e8f53633cfdf7a7147bad6055dcd707a778
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
Steps to reproduce:
- Create a new product as a storable
- Set quantity to 0
- Create a new internal transfer
Issue:
- The forecast button is in green which should not be the case
Solution:
For the internal transfers view, the green forecast button was invisible when "forecast are strictly less than 0". It should be "less than or equal to 0".
Inversely, the red forecast button should be invisible only when is "forecast are strictly greater than 0".
opw-2806764
closesodoo/odoo#88207
X-original-commit: a23108cba301a866504e2fc70aabdaf22c7ee0f8
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
Purpose
=======
Migrate subscription to sales order to simplify the code, the UX & make it more flexible for the future and easier to maintain.
Subscription still appears as a separate module.
This PR aims to move the sale.subscription models to sale.order. The implementation is quite similar to the sale_renting module.
Before this PR, sale.subscription records are similar to sale.order ones. A lot of logic is duplicated to handle the subscription line computations, tax handling, etc.
The current implementation of subscription has several drawbacks:
* the sale.subscription records depends on required sale order template.
* it is not possible to mix different periodicity in a subscription. Each partner has as many contract as periodicity needed (monthly, yearly etc)
* when the flow starts in sale_management, the first invoice must be created from the sale application.
* upsell prorata calculation to apply a discount is flawed when the salesman want to apply another discount.
This PR fixes these issues and make subscription more flexible. One record can have subscription lines with different periodicity. Each line have a next_invoice_date and invoices are generated when they are due with the matching lines.
Before this commit, the sale module could not be used to manage subscriptions in an override.
This commit adapts the sale module to odoo/enterprise#21825closesodoo/odoo#82632
Taskid: 2568007
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The regex patterns for dailymotion and youku were too permissive and
not specific enough for the way they were intended to be used.
The new regexes should correctly isolate the video ID from the URL
string and cover all embedding needs for the two providers.
There are also new test cases for specific embed URL variations.
For the initiating discussion and PR, see following link:
https://github.com/odoo/odoo/pull/44537#discussion_r753250276
task-2696033
closesodoo/odoo#82369
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since [1] the CSRF token used by the donation snippet's form did end up
being cached for new visitors that did not have a session id yet.
This made the validation of the token fail when using the form because
the token from the very first new visitor on the worker was reused.
After this commit pages that contain a Donation snippet are not cached
anymore in order to always get a fresh CSRF token - similarly to what is
done for the form snippet.
When using incognito mode the csrf token is sometimes not recognized
during navigation to the donation payment page.
Simple sequence to reproduce it:
- drop a Donation snippet on the Home page
- use Firefox and do not log in
- in normal browser, select 25 then press Donate Now
- open an incognito browser, select 50 then press Donate Now
=> 400 Bad Request
Alternative (any browser):
- open page with Donation snippet in incognito window
- remove session id from cookies using developer tools
- close window
- reopen page in a new incognito window
- try to donate
=> 400 Bad Request
[1]: https://github.com/odoo/odoo/commit/7fccbac004628093da49016f75370a84bba49465
opw-2774065
closesodoo/odoo#88184
X-original-commit: 16c9b103195f342f8bcca928a53121dbe4480d58
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
In case of purchase agreement, call for tender still appears everywhere
and it's confusing for the user in case of purchase agreement. It would
be better to create another action to have a correct pdf name and report
name but it will be modify in master and we could keep a minimal diff
here.
Also the conditions where not present, so the report could be hard to
communicate to a supplier. Same for the agreement deadline
closesodoo/odoo#88164
X-original-commit: c3b9de36e40c24d0bb521ec0f161d4415b1d86ff
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Before this commit:
When you create a new channel HTML tags are visible in Autocomplete text area
for a split second
After this commit:
Added prevendDefault for the autocomplete select event to stop it's defaullt
behaviour as changing the autocomplete text area's value by the selected item's
value
Task-2792365
closesodoo/odoo#88148
X-original-commit: cc11accfeca4bee0f4a364bf59b6311a99855c2b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when closing an action Dialog ( when the action is
wowl ) an error was raised. This occurs because we use the
LegacyAdaptedActionDialog, and an old function is called.
closesodoo/odoo#88118
X-original-commit: a6e45c53642003243e8a0f498e69ffddcac6e086
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit:
In Discuss topbar, call buttons are added to allow call and video between
channel members. Those buttons were also added to live chat channels but any
voice call or video call features are not available for visitors.
After this commit:
Call buttons will not appear in Discuss top bar for live chat channels.
Task-2744224
closesodoo/odoo#88105
X-original-commit: 1fd8af1a30abbe65fd4266c2fb4793ea2a06fab5
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The image transform option uses the `transform` CSS property, which is
very poorly supported in email clients. This hides that option so as to
avoid bad surprises.
task-2802705
closesodoo/odoo#88052
X-original-commit: 611c9a2aa65f3c6f9e1c0780cb9177bc1e67513d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Purpose
=======
This is the optimal way to add a user on a group, to avoid calling the
contraint method _check_one_user_type on all the users from the group
closesodoo/odoo#87998
Related: odoo/enterprise#25908
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the ProductDiscountWidget (sale.product_discount) worked by overriding the reset method.
The main drawback is that the reset method is called whanever a field on the line is changed.
This commit rely on _onFieldChanged that allows to target single change. A small mixin is created to allow working with different kind of fields of the SOL.
taskid: 2568007
Before this commit, the sale module could not be used to manage subscriptions in an override.
This commit adapts the sale module to https://github.com/odoo/enterprise/pull/21825
taskid: 2568007
Currently, when modifying an invoice line and setting taxes
(price included) for 100%, the price_unit field will
be displayed as 0.
This is incorrect and is being fixed here.
opw-2793284
closesodoo/odoo#88180
X-original-commit: 674eaa3bc10210d34a02145529516da1fa1c1b66
Signed-off-by: Laurent Smet <las@odoo.com>
How to reproduce:
1- Create Product Category "PC" AVCO|FIFO Automated.
2- Create Storable Product "P" with product category PC and unit cost to 1.
3- Create SO with 10 units of P.
4- Create PO with 10 units of P and unit cost of 2.
Delivery of the SO should now have 2 IV layers, with one being "Revaluation of XXX (negative inventory)"
Global IV of P should be 0 qty, 0 value.
5- Return the delivery order of SO.
6- Open valuation of the return
Error: The value is 0, should be 20
In `_get_price_unit`, `price_unit` is taken on the last svl of the origin_returned_move_id, in our case it's the revaluation layer.
`_get_price_unit` now take all svls of origin_returned_move_id into account.
OPW-2784033
closesodoo/odoo#88177
X-original-commit: bfd1a06b054dcc115f7fb0937db98812f4a6d5dc
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: DavidFesquet <dafr@odoo.com>
Unnecessary call to _create_check_sequence because is called in create method and create is called in supper().copy()
TT35608
closesodoo/odoo#88159
X-original-commit: 2f83737b8eb4f2b378cf4d6a6348d9ba15200561
Signed-off-by: Florian Gilbert <flg@odoo.com>
This fix prevents the `/Annot` key from a PDF PageObject
to cause errors during its handling by PyPDF2.
opw-2811793
closesodoo/odoo#88182
X-original-commit: 1c0fc5b20efb9e5829447f97480d0813c6c9e367
Signed-off-by: William André (wan) <wan@odoo.com>
Manual forward port, commit was lost from 15.2 to master. Either it
seemed not needed after the httpocalypse refactoring, or was simply
lost during the rebase.
-----
We can remove an useless SQL Query for public user on every single page
serve, if we directly set the website's company_id in the available
company_ids of the public user.
Indeed, the public user from a website always have the same company_id
as the website.
We can then do that directly and bypass the next line which will
always be true in the case of the public user, making a read for
nothing.
task-2774979
closes#85419
X-original-commit: c95ab6f
[1]: https://github.com/odoo/odoo/commit/728ade674cb12c64718efda56b0d5d542e319cbaclosesodoo/odoo#87856
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
*: test_website, website_blog (test perfs)
An error regarding tests was not catch during httpocalypse [1] review.
The test query counts were lowered in website by 2 everywhere, but it
shouldn't have as there were no SQL perf improvement from this
refactoring regarding website.
The query count actually decreased because the test-only SQL Savepoints
got divided by 2, probably thanks to a low level test improvement in
the PR.
But outside of tests, there were no SQL Query gained.
This should have been reflected in the `EXTRA_REQUEST` variable
instead.
Before:
Savepoint > Rollback > Savepoint > [Actual SQL Queries] > Rollback
After:
Savepoint > [Actual SQL Queries] > Rollback
It is important to fix it because:
1. (Minor) There is a de-sync between the query count in the test and
the actual query count (in the logs outside of tests), making it
hard to figure.
2. (Major) Some controller got then wrongly lowered to 0 query counts
instead of 2. An incoming PR in master would then make those tests
expects negative query counts, which doesn't make any sense.
[1]: https://github.com/odoo/odoo/pull/78857
Note that the exact commit can't be found by bisect as those don't work
on their own, DB can't be started due to circular import.
Part-of: odoo/odoo#87856
Step to reproduce:
- install sale, accounting and l10n_de
- activate proforma in sale settings
- set the template to external_layout_din5008 in the settings (use developer mod)
- create sales order or quotation
- print it as a proforma
Current behavior:
- the proforma is missing from the title in the document
Behaviour after PR:
- the proforma is in the document title
The l10n_de_sale module was missing the case scenario of a proforma sales report and the sale module only
gives the information of a proforma report in the xml context. Then we add the case scenario and propagate
the proforma info from the sale module also in the python context using the proforma variable.
opw-2796603
closesodoo/odoo#88153
X-original-commit: 14e0f84abeba8453930522047df3610940d6aa9a
Signed-off-by: William André (wan) <wan@odoo.com>