Browse Source

[IMP] show count of records

pull/1/head
Ivan Yelizariev 10 years ago
parent
commit
354012203e
  1. 4
      models.py
  2. 2
      static/src/xml/main.xml

4
models.py

@ -78,8 +78,10 @@ Slice - use "domain" for total and "won_domain" for target
} }
obj = self.env[self.model_id.model] obj = self.env[self.model_id.model]
if self.type == 'list': if self.type == 'list':
total_count = obj.search_count(domain)
res.update({ res.update({
'more': self.limit and self.limit < obj.search_count(domain),
'more': self.limit and self.limit < total_count,
'total_count': total_count,
'lines': [], 'lines': [],
}) })
for r in obj.search(domain, limit=self.limit, order=self.order): for r in obj.search(domain, limit=self.limit, order=self.order):

2
static/src/xml/main.xml

@ -8,7 +8,7 @@
<div class="oe_goal"> <div class="oe_goal">
<div> <div>
<a class="oe_update_challenge oe_e" rol="button" t-attf-id="{info.id}" t-attf-model="{info.model}">e</a> <a class="oe_update_challenge oe_e" rol="button" t-attf-id="{info.id}" t-attf-model="{info.model}">e</a>
<h4><t t-esc="info.data.name" /></h4>
<h4><t t-esc="info.data.name" /><t t-if="info.data.total_count or info.data.total_count==0"> (<t t-esc="info.data.total_count"/>)</t></h4>
</div> </div>
<t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'list'"> <t t-if="info.model=='mail.wall.widgets.widget' and info.data.type == 'list'">

Loading…
Cancel
Save