Without this commit, the method `saveModifiedImages` did not use
editables zone but rather the whole `$editable`.
Because of that, oeModel and oeId were undefined and saving images
was done without the proper metadata.
That made impossible the retrieval of the images from the method
`ir.qweb.field.image` `from_html` defined by the module `web_unsplash`.
task-2581567
closesodoo/odoo#77259
X-original-commit: c32ef686e9744fc66f372921fce5cfaff739a76c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Also resulted in crash `Cannot read property 'sel' of undefined`.
This commit adds some guards in some component templates
that access model records and their fields, to avoid crashes.
These guards are necessary due to the asynchronous rendering of OWL,
which makes it vulnerable to risky changes in models such as
record deletion or any modifcation in any relational fields.
Introduced with https://github.com/odoo/odoo/commit/9bf4b6c29207b97368f27098df3cfbe79e2b5f0fclosesodoo/odoo#77258
X-original-commit: 1dbf02ea72aa0599991f05ff2d9d4f4517055eca
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
The Time Off Analysis action should only be available in debug mode.
closesodoo/odoo#77257
Taskid: 2653912
X-original-commit: 1f5e741b42afaef4ffd2e96203bc4f14f75057d2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When creating a wizard `stock.return.picking` and call
`_onchange_picking_id`, the creation of return picking line will perform
a write on move linked with it, due to `uom_id` being set as related with
`readonly=False`. Set `readonly` to `True` to avoid it
closesodoo/odoo#77242
X-original-commit: 6bdc99f8b67da069c8d26c73b5499d0b0c019c1e
Signed-off-by: Tiffany Chang <tic@odoo.com>
Before this commit the scroll position in mobile mode were not kept.
This was because the scroll element was the body node.
After this commit, the scroll is saved and reused correctly as the reference
node is the html node.
This commit makes no sense without its enterprise counterpart. (https://github.com/odoo/enterprise/pull/21150)
closesodoo/odoo#77232
X-original-commit: 4957fd2ceec51ba3907a968bd0fce0512a57f3ac
Related: odoo/enterprise#21196
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to follow
- Go to the variant tab of a product
- Add an attribute and click search more
- Select the checkbox at the top to select all records from the current page
- Click on Select all
- Click on Select
-> Only the records from the first page are added
Cause of the issue
`getSelectedRecords` doesn't return the record from all pages
but only from the current one
Solution
If the domain is selected, use all the records
opw-2586877
closesodoo/odoo#77228
X-original-commit: 963ccf1b4f3bb82c974af2ac0e47344c0ce060ac
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
Before, the taxes assigned by the reconciliation models in their write-offs weren't mapped by fiscal positions. This could cause confusion, and essentially required the user to always fix by hand the cases that weren't matched.
Task 2645280
closesodoo/odoo#77204
X-original-commit: e75184459a7d47df86aa72efa36c06462d7ee9ea
Related: odoo/enterprise#21187
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Multivat means you are submitting its national tax report to a foreign country. In this case, you never want to use OSS taxes for that country. Hence, we exclude the countries for which we are submitting such a report when generating the fiscal positions for OSS.
closesodoo/odoo#77080
X-original-commit: ab2d2916e469586bb6c2b63c49de766369aa7277
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
In javascript, Error.stack is not standard so it could be undefined on
some browsers.
This commit fixes possible crashes when we perform some operations
on error.stack.
closesodoo/odoo#76917
X-original-commit: f8bc701e78b31f90a30baebe734290f6202a0af9
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
These helpers and component should be moved to web_dashboard, which is the only
place they are used. Also, we want to avoid setting a precedent by putting these
in web.
closesodoo/odoo#76912
X-original-commit: 7f4bc27702844cf9b9f010a4ab3c1ac077442ecc
Related: odoo/enterprise#21042
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Merge duplicate code of `_check_move_lines_map_quant_package` (of
`stock.picking` and `stock.package.level`.
Also remove unused `_get_contained_quants` method in
`stock.quant.package`
task-2648449
closesodoo/odoo#76761
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Instead of using sort + groupby of itertools (which group only
consecutive), use only the groupby of odoo.tools which
decrease the complexity of the code and avoid unmatched keys
between sort keys and groupby keys
task-2648449
Part-of: odoo/odoo#76761
The invoicing target on sales team do not have to take the vendor bills into account.
When we click on Sales analysis, we only see sales details.
opw:2557852
closesodoo/odoo#77144
X-original-commit: 26871eabe3f95945c6cf2fc084e3af469ed561f6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When generating coupons for customers, the email was sent twice due to the values
given on the email_values that is generating a TO (email_to) value
(plus using the one given on the template (recipients_ids))
opw-2574046
closesodoo/odoo#77095
X-original-commit: 1eb8cdec60a5f460f57669ce4336efbc5b0279c8
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Dyanmic filters uses ir.filters.
But domain is not exactly the same syntax.
e.g. time.strftime() vs context_today()
So we add a fake action_id to avoid to display these filters on each action
of this model into the backend.
task-2654131
closesodoo/odoo#77021
X-original-commit: f92cfa96b9337fce8451080bffd9b7e40bdedc0d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Now, iap only return images urls needed to process the svg.
We don't need to 'download' svg preprocess, we use the svg locally and make
the substitution ourself.
It simplify the maintenance:
Preview of theme are in theme repository
It make it blazing fast:
Response contains a list of string, and not more a big string, the svg.
closesodoo/odoo#77199
X-original-commit: 103ec4debb539b04b1783be20f1ccf3e18ab377e
Related: odoo/design-themes#503
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Magic return image/svg instead of image/svg+xml if file starts with <svg
+ refactor the import/else to if/else to avoid pylint error:
function already defined line 137 (E0102) at odoo/odoo/tools/mimetypes.py:181
That raises an error during CI/runbot
closesodoo/odoo#77193
X-original-commit: b76f13853a25a93307db2bcafb6a83ad75b92244
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the positioning of the dropdown (which is powered as a poppover)
was executed all the time.
This commit prevents this behavior in mobile, assuming there is not enough space anyway
to have a proper fixed position and that we should use scrolling instead.
closesodoo/odoo#77206
X-original-commit: 1271ef80fafa4438271af0919dcca229aa20bf81
Related: odoo/enterprise#21191
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
when an account.payment object had no partner and no journal, the computation of is_internal_transfer was wrongly computed as True... and the information banner was displayed accordingly
closesodoo/odoo#77122
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
when removing the bank in an account.payment, the method _get_available_payment_method_lines() was called on an empty recordset which wasn't supported.
Part-of: odoo/odoo#77122
Activate the new opt-in option for the collaboration
on some html fields.
closesodoo/odoo#77160
X-original-commit: 504bbafc1d6183e7e8e0a326d1e90eddce6410d7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The new collaboration feature of the web editor was active by default.
We fix it to by making it an opt-in option on the field html.
X-original-commit: 86678b98dad069d864cb78baec5eb8af8bf30ce3
Part-of: odoo/odoo#77160
The fix ff28db335fa77dadc did introduce some differences in the way
forecast filters work for a legacy or a new view. For example, let us
assume we have two filters F1 and F2 active in the same group with F2 a
forecast filter. In that situation, a legacy view would load with
domain = F1 domain AND F2 domain, and a new view would load with
domain = F1 domain OR F2 domain.
In the present commit, we harmonize the behaviors of ForecastModelExtension
and ForecastSearchModel as much as possible. We also make ForecastModelExtension
use a state received when it loads for the first time.
We have also taken the opportunity to normalize the states of the
extensions: it was not necessary to memorize forecastField (constant)
and forecastFilter (determined by the rest of the state).
closesodoo/odoo#77159
X-original-commit: 37aeb048c286f2f1a78370213635341c32ea621b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When a user without an email partner try to create a channel, an exception is
raised because he has no email.
This exception should not happen when creating a new channel.
task-2641660
closesodoo/odoo#77147
X-original-commit: 0970d8767ac27f9542bb3ad40a6f213f80f408d8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Improve the performance/scalability of the forecasted compute.
Duplicate the code of the `_get_report_lines`
(`_get_forecast_availability_outgoing`) and specialize it to only
compute necessary information for the `_compute_forecast_information`.
It is mandatory to readd 'Component/Product Availability' (MO/picking)
which aggregate the result of `_compute_forecast_information`.
Note that with this refactor, it is still too slow to add in the
view normally. We should fetch it with a lazy way.
With a DB populate with 3 company and 6 warehouses (2 for each company),
50 locations, 30K stock moves, 9K quants and 1700 products.
Before fix:
To read 40 confirmed stock move (with forecast information):
35 SQL request, 0.031 ± 0.0004 sec of SQL, 0.204 ± 0.008 sec of Python
=> 0.235 sec
To compute 7300 forecast information (52 draft MO - 99 confirmed MO):
382 SQL request, 1.334 ± 0.052 sec of SQL, 6.807 ± 0.223 sec of Python
=> 8.141 sec
After refactor:
To read 40 confirmed stock move (with forecast information):
35 SQL request, 0.029 ± 0.0004 sec of SQL, 0.074 ± 0.003 sec of Python
=> 0.103 sec
To compute 7300 forecast information (52 draft MO - 99 confirmed MO):
369 SQL request, 0.550 ± 0.009 sec of SQL, 0.969 ± 0.012 sec of Python
=> 1.519 sec
task-2579011
Part-of: odoo/odoo#77092
- Clean the `report_stock_forecasted` for the next commit.
- Add some test about the `_compute_forecast_information` to ensure
the correctness of the forecasted widget.
task-2579011
Part-of: odoo/odoo#77092
The `_compute_warehouse_id` wasn't never batched (never prefetch)
because of the `recursive=True` in its declaration.
Remove the recursion depends and add manual
invalidate cache to stay consistent.
It avoids extra SQL request by prefetching correctly
the `warehouse_id` fields.
task-2579011
Part-of: odoo/odoo#77092
Improve 'Component Availability' and 'Product Availability':
Add these fields in form and tree view (the performance issues
is addressed in next commits and these fields will be load lazily)
task-2579011
Part-of: odoo/odoo#77092
The `_compute_json_popover` of (`mrp.production`)
was slowing down the tree view of MO (because it loaded
every move due to `production.move_raw_ids` even if there
isn't `delay_alert_date`.
Make it more lazier: we gain a speed up
when the there aren't any delay_alert_date
(always when the setup is simple)
To read 150 MO (7500 moves behind):
Before: 0.099 ± 0.002 SQL sec, 0.224 ± 0.005 Python sec (37 SQL requests)
After: 0.060 ± 0.0008 SQL sec, 0.096 ± 0.002 Python sec (29 SQL requests)
Also, unify the code with `stock.picking`.
task-2579011
Part-of: odoo/odoo#77092
The reserved and the done column doesn't have any sense for
draft picking and the forectasted button was always green.
-> Fix it
Also we add forectasted information for draft move in mrp
(281e1a57b3).
-> Use it also for outgoing picking
task-2579011
Part-of: odoo/odoo#77092
In multi-warehouse, when we open the forecasted report from a component
line of MO, the default warehouse in the forecast_report was always the
first of the company. Because it took destination location warehouse
(== False because it is destination location == subcontracting location)
instead of the source location in case of MO.
task-2579011
Part-of: odoo/odoo#77092
This pr proposes an auto retry mechanism for tests. This shouldn't
impact normal testing: tests are not supposed to fail, but the growing
number of tests and pull requests can lead to some bottleneck when a
staging fails because of a random error. This mechanism should help to
reduce splits/the need to retry a failed pr.
This branch have been tested with the nightly multi build, creating 40
identical build without test-tags to disable know random errors.
This multi build is used to detect test failing randomly, this is an
excellent candidate to detect the effect of the retry.
On average, with the current base of this pull request, there is between
10 en 15 failures over 40 build.
With the auto retry mechanism, only 1 build failed over 40 builds since
the same error was triggered twice.
This is simply because with the retry mechanism, an error that has a
probability of p to fail randomly will still have a probability of p² to
fail with the retry mechanism. A error that occurs 10% of the time
should only appear 1% of the time with one retry. In most of the case,
the retry is sucessfull: https://runbot.odoo.com/runbot/build/10053257
The current solution to allow to enable this mechanism only in some
cases (staging) is to check an environment variable
"ODOO_TEST_FAILURE_RETRIES" that defines a number of retry.
This will allow to retry more than once if an error still occurs to ofen
with the autoretry.
The mechanism will run multiple time the same test on the same
test_case, meaning that some modification on self may impact the second
execution. The following code is an example of how this could be
problematic, but also a good example to test the auto-retry mechanism.
```python
class TestRetry(HttpCase):
def test_fail(self):
self.t = getattr(self, 't', 0) + 1
if True or self.t == 1:
import logging
_logger = logging.getLogger('test_a')
with self.assertLogs(level="ERROR"):
_logger.error("This shouldn't be log at all")
with mute_logger('test_a'):
_logger.error("This shouldn't be logged (mute)")
_logger.error("This should be log")
```
As we can see here the error logs are also managed, and emit at a lower level the first time, butany log higher than 25 will make the test "failed" and the autoretry mechanism will be triggered. The second time, everything is logged normally. We also need to replace Traceback by _Traceback to avoid being catched by runbot Traceback detection regexes.
The inspiration here commes from the assertLogs, that replace all handlers. The mute_logger had to be adapted to use the same strategy, so that quite_logger won't detect logs catched by mute_logger or assertLogs.
closesodoo/odoo#76336
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Since odoo/odoo#35700 department_id is not a searchable field in the
employee search view as it has been added in the searchpanel. Since
then, the view from department > absence has been broken since it was
not filtering on the department anymore.
This commit fixes that behaviour by defaulting to the department in the
searchpanel instead.
TaskId-2648380
closesodoo/odoo#77157
X-original-commit: 9200742a1bde75ec2de02b9d11f67dc77538d79d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This branch add new template for the **s_dynamic_snippet_products** and adapt the current ones.
task-2602978
#75623closesodoo/odoo#77153
Forward-port-of: odoo/odoo#75623
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit adds new templates for the s_dynamic_snippet_products
and improves the current templates for a better reading of the product’s
title and a better management of space when the content have different
width.
Part of https://github.com/odoo/odoo/pull/75623
task-2602978
X-original-commit: 49bd79b0bdca76415780bdfa199195371c2692e5
Part-of: odoo/odoo#77153
This commit adds a new template called "Rating: static star compressed
widget".
Instead, having 5 stars, it returns an empty/half/full star with the
average rating. This smaller layout is used in the dynamic snippets
product.
Adapts the style of empty stars (it uses the outline star icon instead grey
background) to work well on light and dark backgrounds.
Part of https://github.com/odoo/odoo/pull/75623
task-2602978
X-original-commit: 0690e187ebb7e67694c8236f420213beed29993d
Part-of: odoo/odoo#77153
Now if you fetch 4 elements, we preset to 4 the number of record displayed
X-original-commit: 5c1d0c4249a16e41eac361728df6e95674e26d3d
Part-of: odoo/odoo#77153
On rendering, we check the higher slide to set this size as min-height of the
carousel and avoid flickering.
X-original-commit: c2e3fdccd84a9077b50d2fcf0dd147026cbc613a
Part-of: odoo/odoo#77153
This commit will correct an inaccurate comment introduced with
odoo/odoo#76951. The comment states that the 'joinButton' shall be
disabled when the current user is NOT a guest, which is not true:
'joinButton' can only be disabled if the current user is a guest.
closesodoo/odoo#77149
X-original-commit: 93a78e437e9c7775f4b174f660e22368bdd4a3aa
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, using a do_action that throws an error opened two
error dialogs.
To solve this, in the compatibility layer, we check that the error has
not already been thrown.
To reproduce the problem, you can execute an action using do_action
which will return an error. For example, an action performing an rpc
and the server returns an error.
You can find an example scenario to test the problem on the 2618694.
closesodoo/odoo#77148
X-original-commit: 582604990e28c329348475f373b03295903ed77e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When booth management is activated, we have a dedicated product for the event
booth. Currently, the product type for this product is set as 'Service'.
This happens after a recent commit[1]. With this commit, we now have a
dedicated detailed product type for event booth, but in data file of
booth product it is set to `service`, which in this case should be
`event_booth`. Apart from that, when creating a booth product for event
booth category, the product type is set as 'consumable', which should
be 'service'.
This commit updates the data for the default booth product and sets the
detailed product type to `event_booth`. And this commit also passes
correct context when creating a product for the event booth category so
that the product type is now set as 'service'.
commit[1] - https://github.com/odoo/odoo/commit/3d7b9bbf27298dc7f2f7e61a13120988f9bd422a
Task-2648950
closesodoo/odoo#77146
X-original-commit: e466430e44844339f1ec9f2ed3c79f6f34501291
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Module `account_check_printing` exist on community edition so
It doesn't makes sense to apply `upgrade_boolean` widget on that.
However, It is necessary to have supported modules installed to
use Check Layout.
closesodoo/odoo#77145
X-original-commit: adc24d9082933f801f972fa93e1866be194c8b7a
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
Deleting record from tasks analysis report tree view has been stopped.
Issue:
If the record is opened from the list view, auto-generated from view is opened,
so the list view is restricted.
Closes#76465
task-2645891
closesodoo/odoo#77094
X-original-commit: e9ad8994c2836fcec41565c40e36784bd6152943
Related: odoo/enterprise#21136
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>