If system user is a sales man, he can't see the right phonecall count in Calls smart button in res.partner form view ( it always shows 0 ), although when clicking the smart button he can see the right number of phone calls in phone calls list view.
my method is :
def _logged_phonecall_count(self, cr, uid, ids, field_name, arg, context=None):
res = {}
for partner in self.browse(cr, uid, ids, context):
logged = []
for call in partner.phonecall_ids:
if call.state == 'done':
logged.append(call)
res[partner.id] = len(logged)
return res
the method returns the right number of phone calls in all cases, but if the user is a sales man it always disaplays 0 in the smart button count, and the sales man has access to those phonecalls