Steps to reproduce the issue:
- Create a product P
- Enable packaging on Purchase
- Create a packaging PA such as 1 PA of P = 70 P
- Create a PO with P and set a quantity of 250 with PA as packaging
Bug:
A Warning was raised saying that we should purchase 280, PA was removed and a
quantity of 249.9 was set.
PS: PA was removed because the quantity was changed and function _onchange_suggest_packaging was triggered
opw:3007165
closesodoo/odoo#105065
X-original-commit: a9514d69006c8a389b64550dbcbf30b19160c300
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
In c989ff339d, odoo module errors now
block the interface with an error message. Currenltly, in order to
support lazy-loading scenarios, the way that scss compilation errors are
displayed to the user is by attempting to import a module that may or
may not be present, and doing nothing when it's not present.
This commit fixes that by instead, writing the compilation error message
to a global variable, logging it in the console, and creating a service
that will display that error on start.
closesodoo/odoo#104671
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
To reproduce the issue:
1. In Settings, enable UoM
2. Edit the UoM 'Dozens':
- Rounding: 1.0
3. Create two products P_finished, P_compo:
- P_finished:
- UoM: Dozens
4. Create a BoM:
- Product: P_finished
- Qty: 1 x Dozens
- Compo: 1 x P_compo
5. Create and confirm a MO for 1 x P_finished
6. Edit the MO:
- Set the producing qty to 1
- Set the 'to consume' quantity of P_compo to 1.23
Error: the consumed quantity of P_compo is still 1.0 (it should be
1.23). If the user tries to set the quantity to 1.56, the consumed
quantity will become 2 (also incorrect, should be 1.56)
The UoM used to round the new consumed quantity of the component is
incorrect. Considering its definition:
https://github.com/odoo/odoo/blob/0fdd35cfb5c7145b3a7a855956004e38de7c6e2a/addons/mrp/models/stock_move.py#L164-L170
the UoM of `unit_factor` is `UoM_sm / UoM_mo`. Therefore, in
`_update_quantity_done` (see diff), when we compute `new_qty`, we have
(in terms of UoM) `(UoM_mo - UoM_mo) * UoM_sm / UoM_mo`. So, the value
is already in the correct UoM (`UoM_sm`) and we just have to round it
based on that UoM
OPW-3016837
closesodoo/odoo#105059
X-original-commit: 90c245a3785a22c9fcbe7dcc2d06ae4205b4fdc9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Steps to reproduce:
- go to Project app;
- go to the 'Project Updates' view of a project.
(project must have task with milestone which has a quantity delivered when the goal is reached)
Issue:
For some quantity percentages, the display of the number of decimals is not correct.
Example: 55, 58, 57, 56, etc. (but not 59, 54, etc.)
Solution:
Use the possibilities of the QWEB to perform a rounding.
Remark:
Widget percentage doesn't work in this case (not a field tag).
`t-options='{"widget": "float", "precision": 2}'` also not working.
`round()` method doesn't work too.
The method toFixed(n) rounds the number to n digits after the point and returns a string representation of the result. (https://javascript.info/number)
opw-3041813
closesodoo/odoo#105056
X-original-commit: fb3052787adf07d0db8e24e7977d0fd88518d0d7
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Previously, when gracefully stopping the server, incoming requests got
queued in the socket's backlog until the workers all finished their
requests, then the socket closes and backlogged requests get their
error response.
This would leave the system administrator with the awkward choice
between giving existing requests time to finish and not creating too
big a downtime for new incoming requests before forcefully shutting the
server down.
As the workers will stop accepting new connections on the graceful stop
call, we can close the socket so the binded address is freed as well.
This allows a cleaner graceful restart of the service as we can
gracefully quit the Odoo server, start a new server on the same address
and let the old service finish its requests for as long as we want.
closesodoo/odoo#104952
X-original-commit: 006a5fa1499dc44be9f2e285637dd0b6a771be16
Signed-off-by: Olivier Dony <odo@odoo.com>
Why traceback occurred:
When we open the task from the milestone dialog, the milestone dialog does not close,
but the component gets destroyed. And when we manually close the milestone dialog,
it tries to load the props. so the traceback occurred.
In this commit:
When the task is opened from the milestone dialog, the milestone dialog will be closed, and
before loading the pros checked whether the component is mounted or not.
Steps:
- Install the project app
- Active Milestones in setting
- Open the Project Updates
- Open any Milestones
- Click on the task stat button
task-3010877
closesodoo/odoo#105027
X-original-commit: 3f08ff262e2943f870e906e06ec90807f581183c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Commit [1] added a regular expression that looks behind to ensure a `-`
is present without capturing it. Unfortunately, the Positive Look Behind
regex (?<=...) is unsupported by Safari as of now (16.1, see [2]).
This commit replaces the regex by removing the '-' after capturing it.
Steps to reproduce:
- Use Safari
- Install website_event
- Try to edit any page with website
- "Invalid group specifier name" error appears
[1]: https://github.com/odoo/odoo/commit/5f1f082dbe268522f8fc7e63ad5f564b25020a22
[2]: https://caniuse.com/js-regexp-lookbehind
opw-3049537
opw-3023128
opw-3023329
closesodoo/odoo#105076
X-original-commit: 08413daa7b62539f86110575f1835d6db271ea10
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Increase code readabilty by replacing "if else" by ternary expression recommanded by python in this uses cases
closesodoo/odoo#104293
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit fixes the formatting of the note field in project
sharing wizard.
The formatting of the wizard broke after the merge of 16.0.
task-3010435
closesodoo/odoo#105054
X-original-commit: e64bb62173578f52efe9251675f17bb78fd6de29
Related: odoo/enterprise#33659
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Introduce the '@mail/model' module that gathers all the stuff involved
in model definitions. This allows us to reduce the number of imports.
* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
website, website_livechat, website_slides
Task-3056971
Part-of: odoo/odoo#105096
This commit introduces component hook useMessagingContainer,
which allow to lazily use messaging component in template.
This allow simplifing some code in container, and more notably
in child messaging components, as they can now define their
template in models.
Task-3055886
Part-of: odoo/odoo#105099
*: hr_holidays, im_livechat, snailmail, website_livechat
Clean template of discuss component templates, so that they
are more appropriately compact, which makes it easier to
read the layout at a glance.
Task-3055780
Part-of: odoo/odoo#105099
This commit simplifies discuss template by putting record accessors
in the context of template.
*: calendar, hr_holidays, im_livechat, sms, snailmail,
website_livechat
Task-3055022
Part-of: odoo/odoo#105099
Commit [1] broke some confirm dialogs because the confirm and cancel
callbacks are not called with the same `this` anymore. Note that [1] was
actually not forward-ported here in 16.0 but now is via this fix.
E.g.:
- Install website
- Go to the page manager (/website/pages)
- Clone a page (choose a name and confirm)
=> Crash (this.$ does not exist).
Note that this flow was quickly fixed with [2] by changing the local
code instead of fixing the root cause (this commit here actually
technically reverts that change so it keeps working). This flow was
also not broken in 16.0 as the code was rewritten differently.
The work done at [1] actually needed some more rework than that to
handle two other potential usecases:
- If the confirm dialog handlers' promises are rejected, the dialog is
not closed (rightfully, like for example allowing to fill an empty
required input)... but [1] prevented to click on the button again
forever. With the same example as above, it can be reproduced: if the
RPC to clone the page fails, I cannot retry.
- If not both confirm_callback and cancel_callback were given, [1] only
prevented to multi-click on the related button (e.g. if you click on
"Ok", a RPC which takes 10 seconds is made, you click on cancel
immediately afterwards -> the dialog is closed while it should be
prevented (and would be if cancel_callback was given, following [1])).
That may not be entirely stable to make this change though but it
seems to make sense and be better (just keeping what [1] wanted here).
Note: this adds some more tests to check all of this + some more things
that were found during development. For example: [1] relied on the fact
that callbacks returned a Promise or nothing... while developers
actually were returning random things (for no reason as no way to get
the result anyway). Adding a test for this prevents to break that in
stable (the first iteration here crashed in such cases).
[1]: https://github.com/odoo/odoo/commit/4b8b079a7d9991a8dc481fe71a45185d672135c9
[2]: https://github.com/odoo/odoo/commit/8216341f5ad8d82ad0bcb0d1f01d874477d2de7b
Closes https://github.com/odoo/odoo/pull/103712
opw-3033878
opw-3043224
opw-3046485
opw-3042542
closesodoo/odoo#105081
X-original-commit: 90b280c221f3c0819cb0b291e102f161fc47507a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the default order used in the project list/kanban
view is only `sequence` but if all projects have the same sequence.
This commit changes the default order to sort by `sequence`, `name` and
`id` as it is defined in the python model.
closesodoo/odoo#104986
X-original-commit: 25efb87f960380dac8093e018a3766bd5041cd0f
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when we create a new task in project gantt
view, the default current user is assigned to the task instead of
corresponding user.
So in this commit, assign the default user along with current user.
task-2920824
closesodoo/odoo#104967
X-original-commit: ab0e072fda7c2dff4ee7916496edfb6da11019ff
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
o_mail_notification should only be hidden when seen from the chatter.
At the moment, the notification is hidden everywhere in odoo and
after this PR the notification are only hidden in the chatter
opw-2720840
closesodoo/odoo#105075
X-original-commit: abddcf8bd4b0ba3d8d45ed1ba4e26c3e112b8edb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Steps to reproduce:
- on Ecommerce website Add an item to your cart.
- Billing/Shipping info > Stop on Payment page.
- Duplicate tab, On the duplicate, add more products to your cart.
- Go back to the original tab (Payment page) > Check out with Stripe.
- Stripe acquirer page does not reflect the updated cart amount.
- Complete payment > Website will say order is confirmed.
- Go to this SO in backend
Bug:
SO is not confirmed and Stripe status says there is a mismatch
because it did not take updated amount.
Fix:
double check the ammount before processing payment
opw-2978244
closesodoo/odoo#105060
X-original-commit: be9d2a57c4628fc867aefc932aaf8c503e76b60f
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Have the following taxes:
- Tax A: 15%, included in price
- Tax B: 21%, included in price
Create a product P with list price 115 and tax A
Have a fiscal positions FPOS configured with:
- Detect Automatically checked
- Country: Belgium
- Map tax on product: A -> B
Open a web shop session as guest, add P to cart
Go to checkout: Price total will be 115
Fill address details with Belgium address
Go to confirmation page
Error:
Price total will be 100. In the application of fiscal position the wrong
unit price is used
opw-2973879
closesodoo/odoo#105061
X-original-commit: 0a8394055221e48c610ad51eef21eb1a16f1e9f9
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Name field can return False, which is not compatible with a replace. We
therefore fallback on a void string, as already done in various other
report names.
Related to Task-2868153 (Mail: Allow multi-reports mail templates)
closesodoo/odoo#105042
X-original-commit: 1e223619e466792c9b073b302ebc9d68cabb9aac
Related: odoo/enterprise#33652
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Following recent changes in stable deleting/archiving product variants forbidden by
attributes exclusions, installing some modules after the sale app failed because
the product `product_product_4d` specified in `product` was deleted by the attributes
exclusions of the `sale` module.
This has been fixed in stable by removing all references to this xml_id.
Nevertheless, this bug showed us that the definition of attributes exclusion
for a product in another module than the one creating it is a bad idea, as it
modifies what's allowed or not with that product, leading to potential database inconsistencies.
This commit moves the exclusions targeting products from the `product`
module to the `product` module, to reduce the risks of other modules using/referencing
the deleted/modified products in a way conflicting with the exclusions.
opw-3040916
closesodoo/odoo#104020
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this patch, when doing an SMTP connectivity check, Odoo always checked if the current user with their current email address could connect.
That was inaccurate because:
1. If the `ir.mail_server` were configured with an email address as `from_filter`, that's going to be the address used to connect with the server always; never your user email.
2. If it were configured with a domain as `from_filter` and your user had an email from another domain, your outgoing emails are going to get wrapped into that domain (SRS-like). Again, the connectivity check wouldn't be imitating real world connections.
After the patch, both situations are taken into account when deciding the outgoing address that's going to be used for testing the connection. This will reduce false negatives when testing connectivity.
@moduon MT-1064 OPW-2942814
closesodoo/odoo#105033
X-original-commit: f1e5e8ca42fbab77649b95fd0b2d09c46f6878fc
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Fixes parsing error that happened when formulas of reports contained indentation (white space, end of line, tabs).
The formula was then not computed correctly and an unclear error message was thrown.
closesodoo/odoo#105028
X-original-commit: 631c1292042083a566072462aa788c6fc410925a
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Fixes the problem that some syntactic sugar formulas were not updated correctly when changed in the xml of reports.
In particular, during upgrade of modules changes were not taken into account.
Concerned syntactic sugar formulas:
- <field name="account_codes_formula">
- <field name="aggregation_formula">
- <field name="domain_formula">
X-original-commit: de9bd10f6e49c529de0d9c835e7185ecb2e699e5
Part-of: odoo/odoo#105028
Before this commit, there was no way to set a finer condition upon which
the KanbanRenderer enables its sortable feature, that is, the drag and drop
of kanban cards.
After this commit, a getter is used instead of the hardcoded condition which checked
whether the the screen was small in the env.
It makes the KanbanRenderer more extendable.
closesodoo/odoo#105026
X-original-commit: 731371320a441cc10b97b7f45b511298c45ae10a
Related: odoo/enterprise#33640
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The main motivation for this change is to improve performance of BoM
`explode`, which heavily rely on checking the lines to skip. `explode`
is also called from product `compute_quantities_dict` which is called
multiple times during upgrades. With this fix we improved the running
time of an upgrade _test_ from 3h:30m to 2h:55m which gives a 16%
performance improvement.
The goal of `_skip_bom_line` is to check that for each attribute present
on the line, at least one value associated to that attribute must be in
the attribute values of the product(*). If none is found then we
consider that we can skip the line.
The previous implementation was inefficient. It grouped all values by
attribute, then checked one by one if at least one value is on the
product. In case one attribute does not have any value on the product it
skipped the line.
The implementation we propose here is to take the intersection of the
product and line values, then check that their attributes are the same.
The later can be done with a simple length check. In case they are
different the line must be skipped. Note that this works because only
one value is possible per attribute in a product.
Both implementations are equivalent. The second is more efficient
because does not branch and relies on (record)set operations.
For example, let's consider a product with two attribute values
`a` and `b`, and a line with multiple values `a`,`y` for
attribute 1, and `z` for attribute 2.
```
Product Line
+---+ +-----+
| a | <- same attribute -> | a,y |
+---+ +-----+
| b | <- same attribute -> | z |
+---+ + ----+
```
This line must be skipped. The reason is that the value `b` is not
among the list `[z]` of values for attribute 2 on the line. The new
implementation would get the intersection of attribute values as `[a]`
from there the comparison of the attributes will fail because `[a]` has
only one attribute while the line has two.
Let's consider a second case, where there is no value on the line for
attribute 2.
```
Product Line
+---+ +-----+
| a | <- same attribute -> | a,y |
+---+ +-----+
| b | <- same attribute -> | |
+---+ + ----+
```
This line is not skipped because there is no value for attribute 2 on
the line. Therefore the condition(*) per attribute is not violated for
this product. The new implementation gets `[a]` as intersection of values,
but now the attributes coincide: they are both attribute 1 for the
intersection and the line.
Finally,
```
Product Line
+---+ +-----+
| a | <- same attribute -> | a,y |
+---+ +-----+
| | <- same attribute -> | z,w |
+---+ + ----+
```
This line is skipped because none of `[z,w]` are in the product. The new
implementation would get again `[a]` as intersection which does not
match the attributes on the line.
closesodoo/odoo#105019
X-original-commit: 47f4c3cc72ecb612ef4edd8c603e27b698187d8a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Steps:
- Install hr_timesheet
- Enable Analytic Accounting
- Create a project and create a task
- Archive the Project's Analytic Accounting
- Open the task and go to the Timesheets page
Issue:
- Warning message box width is small.
Fix:
- Provide the proper format of the warning message.
task-3010437
closesodoo/odoo#105013
X-original-commit: 61eb1a57fd195da1f0bc01886fa568e8e2eb2ee3
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
At the moment, the tree view is quite dense. In order to ease its
use, make company and phone fields optional and hidden by default.
This is done for crm.leads as both leads and opportunities.
Task-3053159
closesodoo/odoo#104759
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, when deleting a message, there was a traceback.
This was caused by `MessageView/onComponentUpdate` wrongly assuming
`MessageView` from a single branching of identifying owner
(`messageListViewItemOwner`), when there is another one
(`deleteMessageConfirmViewOwner`), specific to when a message is
being deleted.
As a result, crash came from programming error of accessor on
undefined relational field.
Task-3055205
closesodoo/odoo#104995
X-original-commit: 1fbc125451c62b444ce49fa11c8216e52e299b64
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
**Issue:**
When a copy clipboard field is empty, there is no way to edit it
because the Field component is not shown.
This issue can be reproduced using any type of copy clipboard field:
- CopyClipboardChar
- CopyClipboardText
- CopyClipboardURL
Check the following video for illustration:
https://youtu.be/CTzqJRtwqv0
**Solution:**
This PR proposes a fix of *always* showing the copy clipboard field
(together with the copy button) even if the content is empty.
For illustration, check: https://youtu.be/jMM7zn_mFCU
**Notable changes:**
- The modified tests were using a wrong class name. But since they were
asserting the "non-existence" of the copy button, they were working.
- We are casting null text field to empty string (just like char field)
so that we avoid crash (in dev mode) when passing a "boolean" as 'content'
props to the 'CopyButton' component. This is asserted in the augmented
test case where we also try to render an empty text field.
closesodoo/odoo#104248
Task-id: 2861388
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit adds the filter for users to see Selected answers given at the time
of registration.
taskID-2995250
closesodoo/odoo#101292
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce
==================
- Create a BOM
- Add a line with a product of type product
- Set the quantity to 0
- Save and click on overview
-> ServerError: Division by 0
Cause of the issue
==================
Lines with a quantity of 0 should be excluded from the computation
opw-3053167
closesodoo/odoo#104980
X-original-commit: b0f5170252ed73d31543b8d1dcf114ae6f0b65bc
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Even if a many2many field is forcely set to be sortable, it should
not be included in the list of custom groupby options if it's
an un-stored field.
closesodoo/odoo#104978
X-original-commit: 9ba52387481bb0720c5d4f5d8a86c3ad6e801137
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
**Issue:** The aggregate row of the list renderer doesn't take into
account the fields with zero values. As a result, average values are
not correctly computed. E.g. average of [2, 0] => 2 instead of 1.
**Solution:** Make sure 0s are included in the valid values to
aggregate.
**Change note:** We took the opportunity to make a simple refactor
in the affected test. Instead of asserting contents of the row
with multiple strictEquals (one per cell), we use deepEqual to
check the cells in the aggregate row.
closesodoo/odoo#104968
X-original-commit: 2dcb71aab911a47d8d3a5db6f68a28d1c6d8c9fb
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
We could do the Group By directly with sql instead of doing the computations by hand afterwards.
As we're already doing a sql query, we can include it here.
closesodoo/odoo#104933
X-original-commit: 3cec95d0a18f3c343db36bb0700936833e98f7fc
Related: odoo/enterprise#33594
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
The smart buttons were computing the number of aml instead of the number
of invoices/bills with the account.
We now compute back the number of moves.
We also changed it so it is consistent with the view,
so it computes the number of moves with move lines that have the distribution
instead of the analytic lines with the account.
X-original-commit: 84f3ee28156721cea0b530b92ede36fad58c5db8
Part-of: odoo/odoo#104933
When executing the product2bom method it is possible that an active_test
context is present in self. However, the method should not consider
archived BoMs.
closesodoo/odoo#104919
X-original-commit: a5f923859fad37e1fc52a3a4bcce5cce4cf69c87
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Prior to this commit get_paperformat function in ir_actions_report.py file
was trying to get a paperformat_id of an empty report and as there was none
was automatically returning company paperformat_id. After this commit said
function will try to get a paperformat_id of the report with specific
report_ref value.
Task-2980708 (Fix Ticket Reports)
Closesodoo/odoo#100199Closesodoo/odoo#104561Closesodoo/odoo#100715closesodoo/odoo#104915
X-original-commit: 78e2c6456d2f9f06d42c18d7b1849d5fad4deb46
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>