Commits on Source (30)
-
Odoo Translation Bot authored119292e9
-
Denis Ledoux authored
This revision adds a flag `_allow_sudo_commands` to which models can opt-in to protect themselves against malicious manipulation of one2many or many2many fields through an environment using `sudo` or a more priviledged user. Flagging a model `_allow_sudo_commands = False` disable `sudo` and `with_user(...)` when manipulating a one2many or many2many field targeting this model. task-3695103
6b9b598f -
bve-odoo authored
do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`Flake8(E721) Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
21ca9767 -
Carsten Wolff (cawo) authored
Context: upgrade script calling `recompute_fields(cr, "sale.subscription.line", ["price_subtotal"])`. It was noticed that this update step runs a long time and is not limited by the DB, but CPU-limited in python. Profiling the code showed that 94% of the execution time is spent in the `filtered()` call in `map_tax()` of model `account.fiscal.position` during this upgrade. The profile also shows that this whole code path effectively creates deeply nested loops, leading to 3.6 **billion** calls to the `lambda` passed to `filtered()` with only ~4k rows on model `sale.subscription.line` (upg-1218044). The idea of this improvement is to - by the grace of `read_group()` - build a dict of ids that maps tax_src_id to dest_ids outside of the loop over `taxes` and then build the result only through lookups from that dict, reducing the loop nesting by two levels. Using cProfile again, it shows that the average runtime of `map_tax()` is ~6x faster with the patch (16.7ms vs. 2.8ms). For above cited upgrade, the process is no longer CPU limited and the runtime of this step is reduced from ~8h to ~3h, which is significant enough to be relevant for upgrades. Considering this code is unchanged on branches up to `master`, this should also reduce response times in normal operation, when recomputations involving multiple calls to `map_tax()` are triggered by user action. closes odoo/odoo#151455 Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com> Co-authored-by: Alvaro Fuentes <afu@odoo.com>
db922a6a -
Denis Ledoux authored
The version of werkzeug installed can vary from one deployment to another, as we recommend to use the operating system package, and the version can therefore change according to the operating system version. e.g. the werkzeug version installed using `apt install python3-werkzeug` varies between Ubuntu 18.04, 20.04, 22.04, 23.10, ... We want to keep under control the attributes developers use on werkzeug.wrappers.Request, to avoid compatibility issues from one version to another. Therefore, this revision aims to subclass werkzeug.wrappers.Request to limit the attributes which can be used. task-3734305 Part-of: odoo/odoo#78857 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
1305e87a -
Odoo Translation Bot authored0c3d16e2
-
OCA Git Bot authored9220c0a6
-
Jairo Llopis authored
Before this patch, if you once had one module available and, later, remove it, you'd be getting an exception when browsing its form view and trying to get its icon image. Now it gets the base module icon image, just like it should. @moduon MT-1524 closes odoo/odoo#105532 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com> Co-authored-by: xmo-odoo <xmo@odoo.com>
e6b300c7 -
OCA Git Bot authored5349bfc4
-
Denis Ledoux authored
For multiple bugfixes: https://github.com/chartjs/Chart.js/releases/tag/v2.9.4 opw-3691601 closes odoo/odoo#149973 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
ea4e78df -
OCA Git Bot authorede2ebd51c
-
Claire Bretton (clbr) authored
In a previous commit we fixed Swiss localization's taxes data. We changed two children taxes that had wrong tax_type_use since it depends on their parents. This could raise the python constraint `_check_children_scope()` which is preventing some databases to correctly update their taxes. See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07 closes odoo/odoo#148724 Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
a6821bdd -
Brice bib Bartoletti authored
Backport of https://github.com/odoo/odoo/commit/51da89abeedefad5dc9b81e96e9b30307bdcbd5e closes odoo/odoo#150188 Task-id: None Signed-off-by: William André (wan) <wan@odoo.com>
69afa4a7 -
OCA Git Bot authoredaf526934
-
OCA Git Bot authored49f94859
-
Claire Bretton (clbr) authored
The upgrade script ignored inactive taxes and was checking wrong xmlids. closes odoo/odoo#150611 See: https://github.com/odoo/odoo/pull/148724 Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
ca8d947e -
OCA Git Bot authored4a9cd584
-
Rahul Prajapati authored
This bug was introduced from this commit 21ca9767 This commit fixes it. closes odoo/odoo#150855 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
28baebfd -
OCA Git Bot authored97539ea8
-
Odoo Translation Bot authored54e8d416
-
OCA Git Bot authored5eccac16
-
Alvaro Fuentes authored
Prevent an infinite loop when the cycle in the parents does not contain the starting id: `3->2->1->2->1...` Example: ``` >>> m=self.env['ir.module.category'] >>> c1,c2,c3 = map(m.browse,[1,2,3]) >>> c2.parent_id = False >>> c3.parent_id = False >>> c1.parent_id = c2 >>> (c3|c2).parent_id = c1 # this never ends ``` With current patch the call to `_check_recursion` successfully detects the new cycle. closes odoo/odoo#151961 X-original-commit: e7c6445dd1896bb182b44af768814f297027d3a4 Signed-off-by: Raphael Collet <rco@odoo.com> Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
aa2fc9da -
OCA Git Bot authored008ead14
-
Odoo Translation Bot authoredc7788176
-
OCA Git Bot authored759e8217
-
Thomas Lefebvre (thle) authored
Correct/improve the view of the point of sale configuration by hiding certain unnecessary parts for certain user groups. closes odoo/odoo#151305 Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
4c926fd5 -
OCA Git Bot authored256404e8
-
Odoo Translation Bot authored2b9cf9c5
-
OCA Git Bot authoredfe12631c
-
OCA Git Bot authoredcb8fd6f5
This diff is collapsed.
This diff is collapsed.