Steps to follow to reproduce the bug:
-In V14
-Go to accounting
-In the tour, click on Create First Bill
-Choose ‘Try a sample vendor bill’ and click on continue
-an error is triggered
Problem:
The returned value of ”create_invoice_from_attachment” method is treated as an “account.move” recordset, but it is a dict used for ‘ir.actions.act_window'
Solution:
We retrieve the ‘account.move’ from the ‘res_id’ found in the dict.
The issue was introduced by this commit : https://github.com/odoo/odoo/commit/8435d0e8990509ee67425977f970ab27bea8133a
opw-2469567
closesodoo/odoo#68595
X-original-commit: 2252cae941efcca36f981d50c546cacf70ff760d
Signed-off-by: William André (wan) <wan@odoo.com>
Special character in reference (eg. '#' character in invoice sequence)
might cause error after payment not showing it was successful.
With this changeset, when a payment reference is used inside an url, we
quote it.
opw-2479658
closesodoo/odoo#68585
X-original-commit: 47645c2f170d5a7c09ae80d4e0de6c3a821f7b36
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Steps to reproduce the bug:
- In Repair: create a new repair order
- add some product to "Add' and operation.
- Select option for Invoice Method: Before/After Repair.
- Confirm Repair, finish repair and create invoice.
Bug:
No line was created in the invoice
PS: the invoice_line_ids were popped from function _move_autocomplete_invoice_lines_create
opw:2493091
closesodoo/odoo#68587
X-original-commit: 952ff15a3af90bb32660262b4fd32ca8a1172eac
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Override in enterprise web_studio of _saveView on error never rejected
promises. But now it does so the XML editor interface is not blocked
after error.
But we were already showing the correct error in web_studio use case, so
we don't want another one and this change allow that by only showing an
error if we received rejection value.
opw-2460081
closesodoo/odoo#68569
X-original-commit: 43184af875f3eb52586348b383627cb0140484f5
Related: odoo/enterprise#17395
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Calling write() on a record will touch it and update its `write_date`,
even if all the field values are identical to the current values.
Let's not touch the mail template unless we have a reason to.
closesodoo/odoo#68562
X-original-commit: ecd0253d1cc231c8695183e1688835b969864362
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
We only support .gif, .jpe, .jpeg, .jpg, .png, .svg
This commit won't let the code go though if we know the image format is not
suported.
Part of https://github.com/odoo/odoo/pull/65828
task-2345082
*: web, web_unsplash
Without this commit, the user had no hint to know something was actually
being performed.
It would be worst when uploading multiple image at once, eg in image
wall, as it could take some times for the images to be processed and
uploaded.
The user now has a visual hint about the upload progress through a
toaster and some progress bars.
For unsplash, note that as the actual image download is performed S2S,
the progress bar will automatically jump to 100%, then will wait for the
RPC success once the server is done to show a success progress bar.
Part of https://github.com/odoo/odoo/pull/65828
task-2345082
Only allow URL ending with extension of supported image formats.
Don't let anything else goes though, so we remove the magic behavior
that was uploading a non-image url as a document.
Part of https://github.com/odoo/odoo/pull/65828
task-2345082
We introduced new Smart Putaway Rules.
Locations now can have a storage category, on each storage category,
we can specify the amount of products/packages(with certian package
type) that can be stored in the location.
On putaway rules, we can also set a storage category. Now when apply a
putaway rule, we will find a suitable child location of the out
location according to quantity/weight setting on the storage category.
Task 2341820
PR #63516
ENT PR odoo/enterprise#15363
UPG PR odoo/upgrade#2040
Currently, delivery packaging and product packaging share the same
model product.packaging. In this commit, we make delivery packaging
a new model stock.package.type. The code is also moved to stock
instead of delivery for compatibility reasons.
Task 2341820
PR #63516
ENT PR odoo/enterprise#15363
UPG PR odoo/upgrade#2040
Let's say we have location A, B, and C. A is the parent of B, B is the
parent of C. And we have a putaway rule to move product from A to B. Now
receive product at C, because currently when we can't find a putaway
rule at one location, we will loop to check its parent locations. So the
puteaway rule A -> B will be found, and product received at C will in
the end be stored at B.
After this commit, we don't check the parent locations when we can't
find a putaway rule.
Task 2341820
PR #63516
ENT PR odoo/enterprise#15363
UPG PR odoo/upgrade#2040
This PR is two-fold. First, it removes a cause non-deterministic failing
builds. The cause was the setTimeout for the quick edit event in FormController
which waits at least 1 tick even if timeout = 0 like in those tests. Now, if this
timeout is 0 then we bypass the setTimeout.
Second, we ensure that the delay is patched to 0 for every tests, and allow
to set it to a specific value is wanted in a given test. Indeed, before this PR,
a patch done in a module was never unpatched, and some tests executed after
passed in the whole suite, but failed when executed alone, because they also
needed the patch.
closesodoo/odoo#68578
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
A lot of tests in different QUnit modules need this delay to be
patched to 0. Some of them (e.g. the 'ActionManager > Misc' module)
didn't patch it correctly. It worked before because a patch was
done in a previous test, and wasn't unpatch. The previous commit
ensures the patch is removed, so now we have at least 2 tests of
the above mentionned module that fail. This commit ensures that
the delay is patched in every tests, and allows to specify a
custom delay if necessary.
For testing purpose, the multi-click timeout delay of the quick
edit is patched. However, in this specific test, it is patched
twice (once to set it to 0 in beforeEach, and once to set it to 50
in the test itself). A single call to unpatch removes the second
patch (50) but keeps the first one, for the remaining of the test
suite. This could lead to weird situations where the whole suite
passes, but a single test executed on its own fails.
Issue spotted in the assets revamp PR, as it alters the test order.
Before this commit, quick edit tests could crash in an undetermined way.
It was due to the setTimeout for the quick edit event in FormController
which waits at least 1 tick even if timeout = 0 like in those tests.
Now, if this timeout is 0 then we bypass the setTimeout.
This reverts commit 825b533ec964fd8a9923dd4d2091f122b92d8759.
For the following reasons:
- This is a behavior change on a stable release. See our stable policy:
https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean
- If a contract end date is set, it's erased when moving the contract afterward.
- There is a cron which is moving the expired contracts automatically,
this will rewrite the end date on it, which is not a big deal, but this
is useless.
- Modifying the contract end date also unlink all the work entries that are
outside of the new contract period. If there is an open payslip, it also
recomputes the worked days lines, and the payslip lines.
That way, it's possible to recompute a payslip by introducing unpaid
time off inside of it. If the payroll officers are checking the payslips
at that time, and don't notice it (already checked, etc...), then at the
validation, this could lead to some more serious issues (wrong net salary
paid to the employee, wrong accounting entries, wrong declaration to the
state, etc).
If the contract end date is badly configured, this is normal that the
reporting is wrong. No need to add some magic that people don't understand,
that could lead to wrong behaviors later on the process.
closesodoo/odoo#68541
X-original-commit: c34b6bc3d0d25e8b8b1bcb6684331627b823f57d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This method is useless and it bypass the computation of some fields
(qty_available, virtual_available, incoming_qty, outgoing_qty). Then
this method is not cache-friendly, and we should use `read` instead.
task-2439019
closesodoo/odoo#66621
Related: odoo/enterprise#16584
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
To avoid multiple search of the get_warehouse for the same location
and extra SQL request (it happens a lot for complicate flow, e.g.
mrp_mps, replenishment report).
Translate it into a standard compute to use the cache of
the ORM for no-store compute field (`warehouse_id`) and put
some depends to be always correct (even if `warehouse_id` shouldn't
change in the same request).
task-2439019
Some usage of `_bom_find` are performance bottleneck (one request by
product). By example, when the mrp is installed, search products
with fields compute by `_compute_quantities` (e.g. 'Negative forecasted
quantity'). it is due to the override of `_compute_quantities`
in mrp which will make (in the worst case) a `_bom_find` for each
product in the DB.
To avoid this situation the `_bom_find` method become batched
which can handle several products in once. The signature of the method
has changed and uniformize in all module.
Example performance Gain:
------------------------
In a DB with 7000 products (type 'product'), 500 locations, 1800 BoM,
9000 Stock moves, etc. Search in the tree view with filter "Negative
forecasted quantity":
Before: 10879 (nb SQL request) 12.67 +- 0.11 sec (Total RPC Time)
After: 159 (nb SQL request) 1.82 +- 0.03 sec (Total RPC Time)
task-2439019
The compute of `product_variant_count` was highly inefficient
in batch. It is due to `with_prefetch` which remove the prefetch
(reset _prefetch_ids = _ids) of the for loop.
It was added by 05a00fa9d4
which fixed performance issue for the 11.0 about
`sales_count`. But with the new ORM (13.0) compute fields are lazy.
Performance improvements:
For the search_read of the kanban view (Menu: Sale/Products/Products)
with the default pagination (80 items):
Before: 347 SQL request and 0.31 +- 0.2 sec (Python and SQL time)
After: 110 SQL request and 0.14 +- 0.2 sec (Python and SQL time)
task-2439019
The purpose is to allow the user to have the opportunity to manage what is
going to be send as reminders. He can now access to the template or create
a new one when the type of reminder is email or sms. In case of a simple
notification, a new text field is added to add custom content.
Task ID-2191254
COM PR odoo/odoo#68443
UPG PR odoo/upgrade#2313
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to ease sending mail to attendees using template
by using a template record instead of an xml id. Indeed this allow having
flows using a configurable template instead of an hardcoded one.
Code in calendar_sms is split into main models to ease future improvements
related to SMS.
Taks ID-2191254
COM PR odoo/odoo#68443
Before the commit, `_action_unfollow()` can be called by
`_message_receive_bounce()` and then multiple leave notifications
can be sent even if the partner has been removed from the channel,
when the partner is a follower of the channel and without a
valid email address.
Unfollow action should also remove the partner from the followers,
and only be processed if the partner is still a member of the channel.
Task id: 2456233
closesodoo/odoo#68314
X-original-commit: 5cf22425eb68f15d94a8b283c50198561bbc240a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit both Google Map and Map snippets were always
available in the block list.
After this commit:
- if the Google Maps API key is specified: only the Google Map snippet
is available
- if the Google Maps API key is not specified: only the Map snippet is
available
- if debug mode is activated: both snippets are available
https://github.com/odoo/odoo/pull/68529
Before this commit filter selection on the dynamic snippet did trigger
the rendering of a preview. This sometimes caused a blocking loader to
appear when the filter selection triggered the replacement of the list
of available templates.
After this commit selecting a filter does not trigger a preview
rendering anymore.
Also the condition for making the warning message appear is now about
the selected template being in the list of available templates.
https://github.com/odoo/odoo/pull/68529
Before this commit the default product category was set on the product
snippet by a wrong use of qweb's <attribute> tag, trying to use t-if to
only apply the change for product snippet.
This actually was ignored and the attribute was appearing on all dropped
dynamic snippets (including blogs).
After this commit the default product category is set on the product
snippet from javascript.
https://github.com/odoo/odoo/pull/68529
Before this commit the blog post snippet templates still contained
CSS references to the cover image loading mechanism that was removed.
After this commit those references have been removed.
https://github.com/odoo/odoo/pull/68529
If we add the id on the values returned by the method
_get_invoiced_lot_values() then we can inherit it to add
custom fields on the table of invoiced lot on the invoice's report.
closesodoo/odoo#68100
X-original-commit: cfff5da8b14bb843537eda13fdb6f971c7074e46
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Josse Colpaert <jco@openerp.com>
Creating a database from the Odoo CLI miserably fails with the error
"psycopg2.ProgrammingError: set_session cannot be used inside a
transaction".
Setting con.autocommit = True fails if some transaction is already
started, which is the case when creating a database. The fix consists
in rolling back the existing transaction (with only a SELECT) before
switching to autocommit.
closesodoo/odoo#68549
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
add mail_tz to calendar_attendee model in order to make it easier to change the
timezone displayed in the mail template so that we can use it to make the
appointment time shown on the email reminder sent to the attendees consistent
with the time shown on the website page.
Change the invitation mail template and use the mail_tz field to display time
field instead of using the partner's timezone in order to make the time shown
in the invitation consistent with the time shown on the website page.
Remove the get_interval method in the calendar_event model and use standard
formatting tools instead, as this is more conveniant than having a custom
method for formatting dates, For this reason the format_time function located
in tools/misc.py has been modified to be capable of handling timezones in
order to be able to display time in the correct timezone, furthermore, this
function has been added to the rendering context provided in the
mail_render_mixin file to be used in email templates.
see: https://github.com/odoo/enterprise/pull/16204
Task-2451154
closesodoo/odoo#65729
Related: odoo/enterprise#16204
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Considering the MO under consumption situation:
component A, to consume = 2, consumed = 1
Previous, after "mark as done", the MO will have two lines:
component A, to consume = 1, consumed = 1, state done
component A, to consume = 0, consumed = 0, state done
Now, after "mark as done", it will be consistent with picking:
component A, to consume = 1, consumed = 1, state "done"
component A, to consume = 1, consumed = 0, state "concel"
Task 2446915
PR #66583
ENT PR odoo/enterprise#16554
This commit is a revert of revert 561b3461a0
and 97ba860fd38c530d3f3678f676754862afad0f11.
Previously we split moves when no picking, now we consider it
unnecessary.
Task 2446915
COM PR #66583
ENT PR odoo/enterprise#16554
* sale_product_matrix
Before this commit, if we created a new row in an editable list view,
do not "touched" it and clicked out of the list then the record tried
to be saved and threw error notifications.
Now, that flow will discard the record to make it consistent with the
form view which discards the record when we leave the form.
task-2431691
closesodoo/odoo#68382
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
PURPOSE
Attract the attention of the user on messages that need action from him in the
mass of messages that are sent in a channel.
SPECIFICATIONS
Highlight messages mentioning the current user in a channel.
Task-2365956
closesodoo/odoo#66889
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
As no global rule is defined for system, people belonging to both system
and a functional group may be limited in their rights about sms templates.
For example install event_sms -> admin is member of system and event manager
groups. He cannot edit templates other than related to event.
With this commit members of system may write, create or unlink all templates
independently from their functinal groups.
Task ID-2495426
Followup of odoo/odoo#64626closesodoo/odoo#68535
X-original-commit: e0c1563993da918a0fbc2e31a13f3fe6a7ea2916
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Several documentation pages have been removed lately.
Indeed it holds more adavanced functional or technical
flows and less basic pages. eLearning notably is more used.
A link to SMS documentation is still present in base_setup
but related documentation has been removed so it is leading
to `404 Not Found`.
This commit fixes the issue by removing the broken help link from
settings.
taskID-2489666
closesodoo/odoo#68532
X-original-commit: 3b3581c3e600c38318403543cae2f8d0c9ac5673
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>