summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorIvan Yelizariev <iel@odoo.com>2021-05-11 07:24:14 +0000
committerIvan Yelizariev <iel@odoo.com>2021-05-17 08:48:48 +0000
commit09da295fd8a5f4f40178b83e9c4e86bcc9a9bc28 (patch)
tree9c35f4ee3e5f0cbb3f7101f2bc6f75bdb379dc30 /addons
parent7f9cacd40d185bb7c943bd2adb7de1ef8a39c367 (diff)
[FIX] purchase: speed up search for purchase_vendor_bill_id
When partner is not selected, Odoo sends name_search request `[..., ('partner_id', 'child_of', [False])]`. It's not obvious what does such domain mean ( see #70584 ). This commit clarifies what do we expect to get: we want all records without restrictions on `partner_id` value. This also fixes performance issue because domain leaf `('partner_id', 'child_of', [False])` is converted to where-clause `<table>.partner_id in <all or almost all ids>` --- opw-2524010 closes odoo/odoo#70842 X-original-commit: 39e0f1fb0f60f309be7f65562911b1236167dce7 Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com> Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/purchase/views/account_move_views.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/purchase/views/account_move_views.xml b/addons/purchase/views/account_move_views.xml
index 565cab9d442..c24f8140207 100644
--- a/addons/purchase/views/account_move_views.xml
+++ b/addons/purchase/views/account_move_views.xml
@@ -14,7 +14,7 @@
<field name="purchase_vendor_bill_id" nolabel="1"
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}"
class="oe_edit_only"
- domain="[('company_id', '=', company_id), ('partner_id','child_of', [partner_id])]"
+ domain="partner_id and [('company_id', '=', company_id), ('partner_id','child_of', [partner_id])] or [('company_id', '=', company_id)]"
placeholder="Select a purchase order or an old bill"
context="{'show_total_amount': True}"
options="{'no_create': True, 'no_open': True}"/>