mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-24 01:52:04 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -14,9 +14,9 @@ class ResPartner(models.Model):
|
|||
def _compute_certifications_count(self):
|
||||
read_group_res = self.env['survey.user_input'].sudo()._read_group(
|
||||
[('partner_id', 'in', self.ids), ('scoring_success', '=', True)],
|
||||
['partner_id'], 'partner_id'
|
||||
['partner_id'], ['__count']
|
||||
)
|
||||
data = dict((res['partner_id'][0], res['partner_id_count']) for res in read_group_res)
|
||||
data = {partner.id: count for partner, count in read_group_res}
|
||||
for partner in self:
|
||||
partner.certifications_count = data.get(partner.id, 0)
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ class ResPartner(models.Model):
|
|||
|
||||
def action_view_certifications(self):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("survey.res_partner_action_certifications")
|
||||
action['view_mode'] = 'tree'
|
||||
action['view_mode'] = 'list'
|
||||
action['domain'] = ['|', ('partner_id', 'in', self.ids), ('partner_id', 'in', self.child_ids.ids)]
|
||||
|
||||
return action
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue