[FIX] customer: sale order number with child
The number of sale order on a partner form view only counted the given customer and not the ones of eventuals child_ids. Hence when clicking on the widget, the result sale order tree view (which take account of child_ids sale order) is inconsistent. This fix adds the sale order of a child company to the sale_order_count. opw-630249
This commit is contained in:
parent
f18b46fcde
commit
32bc9fcb3a
|
@ -29,7 +29,7 @@ class res_partner(osv.osv):
|
|||
# The current user may not have access rights for sale orders
|
||||
try:
|
||||
for partner in self.browse(cr, uid, ids, context):
|
||||
res[partner.id] = len(partner.sale_order_ids)
|
||||
res[partner.id] = len(partner.sale_order_ids) + len(partner.mapped('child_ids.sale_order_ids'))
|
||||
except:
|
||||
pass
|
||||
return res
|
||||
|
|
Loading…
Reference in New Issue