mirror of
https://bitbucket.org/presik/trytonpsk-purchase_co.git
synced 2023-12-14 06:43:05 +01:00
Fix
This commit is contained in:
parent
e61ea07b37
commit
1f80eb4ffe
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue