From 1f80eb4ffecf88a38e653f9cd3eac87cb4d85928 Mon Sep 17 00:00:00 2001 From: oscar alvarez Date: Tue, 16 Aug 2022 11:01:25 -0500 Subject: [PATCH] Fix --- product.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/product.py b/product.py index db39134..ec9afdb 100644 --- a/product.py +++ b/product.py @@ -15,10 +15,11 @@ class Product(metaclass=PoolMeta): InvoiceLine = Pool().get('account.invoice.line') products = InvoiceLine.search_read([ ('product', '=', self.id), - ('invoice.state', 'in', ['posted', 'paid']), + ('invoice.state', 'in', ['posted', 'paid', 'validated']), ('invoice.type', '=', 'in'), - ], fields_names=['unit_price'], order=[('invoice.invoice_date', 'DESC')], limit=1) + ], fields_names=['unit_price'], order=[ + ('invoice.invoice_date', 'DESC')], + limit=1) if products: res = products[0]['unit_price'] return res -