diff options
| author | Ivan Yelizariev <iel@odoo.com> | 2021-05-04 14:40:13 +0000 |
|---|---|---|
| committer | Ivan Yelizariev <iel@odoo.com> | 2021-05-07 07:15:54 +0000 |
| commit | 4ed6527cb414ee11d9bfac43a78dcc68ce233d07 (patch) | |
| tree | 37339e6fd342821952acb5abd04b6aba96285f9a /addons | |
| parent | 879647265bf804e63bd8e89ec3ca58b51ffb29ea (diff) | |
[FIX] sale: fix search "invoices is not set" for sale.order
BEFORE this commit query "invoices is not set" was tranformed to
query "order_line.invoice_lines.invoice_id is False", which doesn't make sense,
because invoice_id is required fields and hence always set. Hence, result of
the query was always empty.
AFTER: just check that there is no invoice_lines. Strictly speacking, is not the
same as checking result of compute method, but because invoice_lines are
supposed to be lines for invoices of out_* type, the result should be the same.
---
opw-2516124
closes odoo/odoo#70493
X-original-commit: 540b45cc7985ac25ca9f71b3a69b5b9e49003086
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sale/models/sale.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index cfbb6b9a369..9c28c66a593 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -138,6 +138,8 @@ class SaleOrder(models.Model): """, (list(value),)) so_ids = self.env.cr.fetchone()[0] or [] return [('id', 'in', so_ids)] + if operator == '=' and not value: + return [('order_line.invoice_lines', '=', False)] return ['&', ('order_line.invoice_lines.move_id.move_type', 'in', ('out_invoice', 'out_refund')), ('order_line.invoice_lines.move_id', operator, value)] name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True, states={'draft': [('readonly', False)]}, index=True, default=lambda self: _('New')) |
