When the blacklist table is filled with multiple thousands of records
searching the `is_blacklisted` field leads to a domain like
`[('id', 'in', [thousands_of_ids])]`. This can create a multiple megabytes
sql query.
Using inselect allows to avoid that issue.
Task-3328210
closesodoo/odoo#136089
X-original-commit: e00dce5edc1e4e0452a9add775ef46a1c993a17a
Related: odoo/enterprise#47677
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Sometimes, no picking type match the domain, but picking_type_id is a required field.
closesodoo/odoo#97278
X-original-commit: afcad067bccc7676b4e40cc57f8d9b5792068802
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
In 13.0, some account.move.line fields (amount_currency, debit, credit
and account_id) couldn't have a value when the line is of type 'note'.
Skiping them during line copy for notes is not an issue.
During 12.0->13.0 migration, we were facing issues with "grouped similar
invoice lines in a single move line", because this feature is not
available anymore in 13.0. To avoid any "loss of data" during migration,
we used lines of type note to create "missing" invoice lines in move
lines without altering accounting in any way. As a consequence, we have
13.0 databases with lines of type note having values for fields who
couldn't have ones.
closesodoo/odoo#64962
X-original-commit: 677edafeaf8d691764178f5e7e9639017b0249a8
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
the search for sequence include a criteria `date_trunc('year', date) =
date_trunc('year', '2017-10-01'::date)` Which is translated by query
planner in `date_trunc('year'::text, date::timestamp with time zone)`.
As it's mutable thanks to the time zone, it's not indexable. Enforcing
the `without timezone` makes the query planner use an immutable
`date_trunc('year'::text, date::timestamp without time zone)`. As it's
immutable, it's indexable.
closesodoo/odoo#56244
X-original-commit: 70f671a32a504c6aa92fd19e38e6151c10b2325b
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
inherit the view which contains the items you're relying on.
closesodoo/odoo#52017
X-original-commit: 03dacc25ef46718a00fa7a1e0440813132600bfe
Signed-off-by: Christophe Simonis <chs@odoo.com>
If some filter domains use M2O to models current user cannot access,
using sudo() permit to filter even when user cannot access linked
models.
for the accuracy of the fix, add a unit test which reproduce the exact
reported bug.
closesodoo/odoo#44923
X-original-commit: 30e2153539643491fad889811a54a8e580fa9c58
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
At model level, activity_type_id is not a mandatory field on mail.activity.
Indeed required is added in views, meaning people could have activities
without type.
This make the activity views crash with `TypeError: 'bool' object is not
subscriptable` error when computing aggregated activity data. This commit
fixes that error.
Activities without type are still not displayed in the activity view as
columns are based on available activity types. It means activities without
type have no column to be displayed. As this is a corner case that should
not happen when using activities using the interface this is considered
as a limitation of current implementation.
closesodoo/odoo#42991
X-original-commit: 77f0dd8936df3dddfa3df8041d4b7f7c62595430
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
some fields may depend on invoice_ids, which lead to a perf issue when
field is not searchable.
closesodoo/odoo#42950
X-original-commit: 53f363269c21eb6b2615d660f1c558c5a592e04b
Signed-off-by: Christophe Simonis <chs@odoo.com>
Accountant who change the lock date is not always a pos user, and then
cannot read pos sessions.
closesodoo/odoo#42156
X-original-commit: 8c6aa24525eca434b6f85b56c10c45b33cc05a43
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
return empty string instead of None to avoid `TypeError: argument of
type
'NoneType' is not iterable`
closesodoo/odoo#41772
X-original-commit: dd65c9fd7213f3d780a733e67390b2ae59f0f526
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
If a module add a state field on another table used by this report,
PostgreSQL will report a:
```psycopg2.ProgrammingError: column reference "state" is ambiguous```
closesodoo/odoo#41350
X-original-commit: 16ae8aed10c72586a3a3e8b7484099263b0d7804
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
Previous versions of this action were setting a domain. Removing the
domain field, instead of setting it to empty value, have not the same
result for upgraded databases.
closesodoo/odoo#34454
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Contracts are only accessible by managers which raise an exception in
_create_resource_leave if not sudo()
closesodoo/odoo#33613
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
left join lateral is the postgresql optimized way to use parameters in
sub queries.
closesodoo/odoo#33526
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
attrs use a field only accessible to members of group users.
If any user non member of group user, like user_id 1
during a migration, reach this view, you got an error.
Improve performance (* 2.5) on _compute_reserved_availability
`mapped` makes use of orm prefetch, which is inefficient in this use
case when facing high volume.
Closes#21198
When creating orders from the interface, all the orders of the current session
are in the cache and slow compute methods are recomputed.
Clear the cache before evaluating to execute _compute_amount_all on the current
order only.
The cache mechanism has changed in v10 and no longer contrains all orders.
opw-741442
When recomputing stored function fields, the `write` may trigger a
cache invalidation which lead to a recompute of all the recordset
values, even the ones already saved in database.
- Only invalidate cache for fields and records we modify
- Rewrite query to be more efficient
- Avoid o2m commands to be more efficient; write directly on reverse m2o
With new api, this call is not wanted anymore. The cache is cleared
automatically, no need to clear the whole cache; that's a little bit
overkill and reduce performances.
The quantity is not correctly computed, and therefore the weight is
wrong.
The fix uses the appropriate _compute_qty method to convert the
quantity.
Closes#10204
opw-660801
In a real environment with a big dataset,
the query reponse time decreased from 750s to 6s,
by using a join on the sub-select instead of redoing
the select for each line.
Fixes#8812Closes#9128
Using BIGINT id instead of Text
- This doesn't change the behavior, just the variable type,
while being much more efficient.
Using `UNION ALL` instead of simple `UNION`
- This doesn't change the behavior either,
as the ids of each sub select cannot collide
Closes#9197
opw-650598
name_get of pos.category should use a browse instead of a read.
For a company having thousands of products and a few categories, using a browse
will greatly improve the load time as it is cached.