Steps to reproduce the bug:
- Create a Kit product "Kit 1":
- Add a BOM with a component “C1”
- Add a sales description
- Create another kit product without a sales description "Kit 2":
- Add a BOM with a component "C2"
- Make sure you have a qty of “C1” and "C2"
- Create a SO:
- Add "Kit 1" and "Kit 2"
- Add any other storable product
- Confirm the SO
- Go to the delivery → validate it
- Print the delivery slip
Problem:
The report doesn’t contain the kit product.
Because in the report, the `stock.move.line` are filtered by checking
the name of their move if it has the same name as the product in
the bill of material, but like the `stock.move` has the name
('description') of the `sale.order.line` instead of the product name,
the lines are filtered and not displayed:
https://github.com/odoo/odoo/blob/14.0/addons/mrp/report/report_deliveryslip.xml#L9
The behavior is the same for purchase orders
opw-2960467
closesodoo/odoo#105158
X-original-commit: be25cea0d882bb03a4873821fdb788a0890ba49a
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
When printing a check that comes from an expense,
the check has no reference to the move from which
the payment has been created.
The reason is that we filter the move by taking
only outbounds to complete the check informations,
but moves from an expense are of type entry.
With this commit, we allow moves coming from
expense to be taken into account by adding a
check on move.move_type.
opw-3044141
closesodoo/odoo#105157
X-original-commit: b588329a45633f0dec89fe195cf24a8b3671dedd
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
During the Early Payment Discount task, the transfer_account_id field was mistakenly removed from res_config_settings_views.xml.
Reintroducing it as intended.
closesodoo/odoo#105146
X-original-commit: 86b73a7b1696d13330cbee063424d989b585fe5c
Signed-off-by: Laurent Smet <las@odoo.com>
In python we can use the default value in dict get method instead of "if else" statement,this will make the code more pythonic.
closesodoo/odoo#105104
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
In project sharing form view the "Remaining Hours" label is not aligned to
"Hours Spent" label due to extra span inside the form view.
so in this commit fixes this issue by hinding extra span by adding attrs.
taks-3034048
closesodoo/odoo#105141
X-original-commit: b0361fff58862c086c82baffe085b593a3688753
Related: odoo/enterprise#33697
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Before this commit, since there is a mildly transparent filter over the
entire view when the "no content" helper is displayed, the interactive
elements of the empty kanban view (namely: the title with the name and
"quick create" button) were slightly hidden.
This commit enforces a superior z-index on those elements s.t. they can
appear on top of the helper's filter.
closesodoo/odoo#105140
X-original-commit: cbefc9cd51b3c903a6c54d8e3f95bf2b592cf402
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This addresses issues with image dropping and pasting.
1. The code to compute the position of the drop was not always run so
that resulted in a sometimes wrong position (dropping at current range
instead).
2. Images dropped internally within a same document should not be
converted to base64.
3. Dropping an image should apply to it the `img-fluid` class so as not
to break the document's layout.
task-2954499
closesodoo/odoo#105137
X-original-commit: 9c258bf18c17a55f1d22c8a7d1b74f5dd51ee73d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The `getTraversedNodes` function sometimes failed to include descendants
of traversed nodes, which should logically be included. Eg,
`<div>[<img>]</div>` where the selection is expressed as `div 0 div 1`:
the iterator is set on the common ancestor, which is the `div`, so it
stops immediately, only returning the `div`. Here we add its ancestors
in every case.
X-original-commit: 0e765277871a57c367d09fc05bb13a9d6670d11d
Part-of: odoo/odoo#105137
When discarding the link dialog, we need to restore the selection in the
editable area. This failed because the selection was recomputed when the
dialog was actually removed from the DOM. This is the same case as a
couple of lines above the restoration of the selection, where we need to
wait for the element to be removed before triggering a focus on the
inserted link.
task-3000250
closesodoo/odoo#104847
X-original-commit: 6b86f6c91fc69bec59f39377e322d79242466d42
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Since [this commit], following these steps:
- Go to /blog
- Activate the sidebar option
- Select a date filter on the sidebar
=> An error occurs.
The bug comes from the fact that since [this commit], some arguments
were passed twice to a function which causes a python error. The fix is
just to not pass the same argument several times.
[this commit]: https://github.com/odoo/odoo/commit/f2e20e5377a6604084aaf509f57614d7fbf263e5
Related to opw-2882492
closesodoo/odoo#104639
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover
- Click on the "guides" tag of the "Buying A Telescope" blog
No blog is displayed. This was because the top banner post is not shown
when the posts are filtered. Basically, once filtered, a blog post was
always missing.
Related to opw-2882492
X-original-commit: ee2f778abb8b7a6e221e05361bc7b964593d1123
Part-of: odoo/odoo#104639
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover
The URL to which we are redirected when we click on the category of the
post presented at the top of the page leads to an error. In order to fix
the wrong url we had to patch QueryURL so that the url prefix is added
only if the url does not already start with the prefix.
opw-2882492
X-original-commit: https://github.com/odoo/odoo/commit/2b326de107b9b7a2013ee9ff174d81b645d6a623
Part-of: odoo/odoo#104639
This commit make timesheet page of tasks related to time off types readonly
so user can not create,update or delete timesheets create by leaves
task-2888607
closesodoo/odoo#96359
Related: odoo/enterprise#29678
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
_* = project_timesheet_holidays
Currently, if the timesheet is associated with timeoff and it is deleted, a
user error occurs.
In this commit, RedirectWarning will appear instead of user error, so it can be
redirected to the timeoff linked to the timesheet.
task-2888607
Part-of: odoo/odoo#96359
I do not see a good reason why height, width, length are integers.
It has been introduced in 2015 here: 2ff3749064https://github.com/odoo/odoo/pull/9994
Having float is better : it's allow more expressiveness and is less prone to errors for our users.
closesodoo/odoo#85268
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Prior to this commit, some scss selectors where duplicated
(`.select2-results`) and where not targeting the right element.
This commit also changes the css variables name based on the right
structure : --component__childItem-property--state
task-2710677
closesodoo/odoo#105118
X-original-commit: 25a7ca929b4342fe7b2941f941a001e0dd0370e9
Related: odoo/enterprise#33689
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
*: test_website, website, website_blog, website_event, website_forum,
website_sale, website_slides
Reverts this refactoring because it breaks multi-tenancy: if several
databases run on the same server and different modules are installed
in each database, the global variable becomes wrongly populated.
Steps to reproduce:
On runbot:
- Go to the `-base` URL or simply select the `base` DB
- Drag & Drop the search snippet (and let it set to "Search in
Everything")
- Try to use the snippet -> Crash on unknown model
On Odoo.com saas DB:
- Drag & Drop the search snippet (and let it set to "Search in
Everything")
- Try to use the snippet -> Crash on unknown model (unless you installed
each and every module related to the search snippet)
Locally:
- odoo-bin -d first -i website --stop-after-init
- odoo-bin -d second -i website_blog --stop-after-init
- odoo-bin -d first,second
- Try to use a search bar on "first" database (using "Search in
Everything") => it tries to access the blog models.
Revert of PR: #98423
opw-3045092
closesodoo/odoo#105077
X-original-commit: 5806f71af1b6f44aac063f7e504be736300f699d
Related: odoo/enterprise#33669
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
The scheduled end date of a work order is not consistent with its
scheduled start date when starting the work order
Steps to reproduce:
1. Install Manufacturing
2. Go to Settings > Manufacturing > Operations and enable Work Orders
3. Create a manufacturing order for any product, with any component and
a work order
4. Confirm and plan the MO
5. Edit the scheduled start date of the work order to the next working
day and save
6. Start the work order
7. The scheduled start date changes but the scheduled end date doesn't
Solution:
When starting a work order, change the `date_planned_finished` according
to the new `date_planned_start`
opw-3005767
closesodoo/odoo#105055
X-original-commit: 0edeed2ff07693933aaf1a17958b5c5fc9a65c35
Related: odoo/enterprise#33661
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
`action_view_pos_orders` is unused and it is incorrect
because it generates a wrong domain (`('id', 'in', pos_order_ids)` where
`pos_order_ids` is a list of tuple(<id>, <display_name>))
Part-of: odoo/odoo#104838
Reading only 'id' with `search_read` is equivalent to use `search` but
complexify the result usage. Fix all these bad usages.
Part-of: odoo/odoo#104838
Co-authored-by: Julien Castiaux <juc@odoo.com>
Change isolation link unit tests to cover both deleteBackward methods :
- deleteBackward via direct contenteditable command
- deletebackward via input event ( mobile )
task-3054245
closesodoo/odoo#105066
X-original-commit: 123051fc8b61e27fc8e39f0fed02a58186fca7e3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Sometimes the link isolation was broken when
the editor rollbacked some browser behavior :
the content editable was reset on the all editable.
And thus the cursor was able to get out of the
isolated link creating issues.
task-2957000
X-original-commit: 0a04ef6c2617741b90c151c367c1731ed180ad70
Part-of: odoo/odoo#105066
We avoid listening to mutation during test selection "[]" rendering.
Those rendering would be registered by the editor and sometimes wrongly
put the editor in rollback mode.
X-original-commit: cb9348e3f7a95d787337b5c3c8fbba5cf6c9e7c4
Part-of: odoo/odoo#105066
Paste a url in the editor from the URL bar of the browser. If you then
select it all and paste another URL in its stead, the zws inserted by
the sanitizer when deleting the selection ends up in the URL.
This is because the sanitizer moves downward into the DOM tree,
therefore change the link URL before removing the zws in its text child
node. To make sure this can't ever happen, we now remove zws from URLs
when parsing them from the link's text content.
task-3054233
closesodoo/odoo#105045
X-original-commit: c4c9627297c0e3e3977cbfd51129227f8ec1ce3c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Steps to reproduce:
- Accounting app > Customers > Invoices
- Create invoice with customer and a couple of products
- In the terms & conditions tab at the bottom, add 20-30 empty lines
and then a heading (/h1-3) with some text. This insures that the printed
report will have more than 1 page.
- Go back to the Invoices list view
- Select the invoice + another random one > Print > Invoices
A traceback appears in _render_qweb_pdf: `KeyError: 'attachment'`
When printing more PDF files at once, several condition have to be
respected in order to also save them as attachments. If the conditions
fail, the PDFs are not saved as attachments and a default dict is
returned, containing the undivided content stream.
The traceback is raised because later we check if an attachment already
exists, even if the files were not saved.
Bug introduced in https://github.com/odoo/odoo/pull/97050.
Solution:
If the conditions fail, add {'attachment': None} to the return dictionary.
opw-2882507
closesodoo/odoo#104916
X-original-commit: 8e3db19f881e3fb72d8a31f56d7cea8876dc57a4
Signed-off-by: Olivier Dony <odo@odoo.com>
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
Steps to reproduce :
In a Manufacturing Order, update quantity (product_qty)
Expected behavior :
In the "Components" tab, "To Consume" column should update without Save
Actual behavior :
Due to "mrp_should_consume" widget not being reactive, should_consume_qty is not updated in the view until it's saved.
closesodoo/odoo#104364
Task: 2985735
X-original-commit: b3ec31d89eb635b555f77b3eb9ecaac4c65981e6
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Before this commit, if a user creates a bill from a PO and confirms it.
A stock valuation layer is created. if the user sets the bill to drafts and changes
the product price. a new layer corrects the difference. if the user does
it again, the new layer ignores the previous correction layers, resulting in
wrong valuation.
This commit hides the 'Reset to Draft' button when there are correction layers
found.
closesodoo/odoo#103347
X-original-commit: d3d41c7679f9068a7b986925b15d0d7670233bfc
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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