[FIX] purchase: supplier invoice and purchase order count

Value of purchase_order_count and supplier_invoice_count should be coherant with
the behaviour of the button on partner form: count records for the contact of
the company as well.
Fixes #4224
This commit is contained in:
Gaurav Panchal 2014-12-16 14:38:53 +05:30 committed by Martin Trigaux
parent e2ea82506e
commit a9b4c56343
1 changed files with 2 additions and 2 deletions

View File

@ -30,8 +30,8 @@ class res_partner(osv.osv):
Invoice = self.pool['account.invoice']
return {
partner_id: {
'purchase_order_count': PurchaseOrder.search_count(cr,uid, [('partner_id', '=', partner_id)], context=context),
'supplier_invoice_count': Invoice.search_count(cr,uid, [('partner_id', '=', partner_id), ('type','=','in_invoice')], context=context)
'purchase_order_count': PurchaseOrder.search_count(cr,uid, [('partner_id', 'child_of', partner_id)], context=context),
'supplier_invoice_count': Invoice.search_count(cr,uid, [('partner_id', 'child_of', partner_id), ('type','=','in_invoice')], context=context)
}
for partner_id in ids
}