[FIX] crm_claim: _claim_count
When clicking on the smart button "Claims" of a contact, it shows
a tree view with all the claims of this contact and his children(because
the domain on the filter is [('partner_id','child_of',self)]).
So the function _claim_count has to return the sum of the # claims
of a contact and the # claims of the children of this contact.
opw:708698
This commit is contained in:
@@ -171,8 +171,8 @@ class res_partner(osv.osv):
|
||||
def _claim_count(self, cr, uid, ids, field_name, arg, context=None):
|
||||
Claim = self.pool['crm.claim']
|
||||
return {
|
||||
partner_id: Claim.search_count(cr,uid, [('partner_id', '=', partner_id)], context=context)
|
||||
for partner_id in ids
|
||||
partner_id.id: Claim.search_count(cr,uid, ['|', ('partner_id', 'in', partner_id.child_ids.ids), ('partner_id', '=', partner_id.id)], context=context)
|
||||
for partner_id in self.pool['res.partner'].browse(cr, uid, ids, context=context)
|
||||
}
|
||||
|
||||
_columns = {
|
||||
|
||||
Reference in New Issue
Block a user