[IMP] progress bar precentage count and added action on button

bzr revid: rgaopenerp-20120704070356-35czqiavzjb1n0y1
This commit is contained in:
RGA(OpenERP)
2012-07-04 12:33:56 +05:30
parent a19f996a2f
commit 81415e4df6
2 changed files with 15 additions and 6 deletions
+13 -4
View File
@@ -29,11 +29,20 @@ class account_move_partner_info(osv.osv):
_auto = False
def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None):
#ToDo
res = {}
res = 0
cr.execute("""SELECT partner_id, reconcile_id
FROM account_move_line WHERE state <> 'draft'
GROUP BY partner_id, reconcile_id""")
result = cr.fetchall()
partner_total = len(result)
partner_reconcile = len([ (x,y) for x, y in result if y == None ])
if partner_total:
res = float(partner_total- partner_reconcile)/partner_total * 100
res_all = {}
for id in ids:
res[id] = 50
return res
res_all[id] = res
return res_all
_columns = {
'partner_id':fields.many2one('res.partner', 'Partner'),
@@ -18,8 +18,8 @@
<field name="latest_date" />
</div>
<div class="oe_button_container">
<button string="Reconcile" name="170" widget="list_button" type="action"/>
<button string="Nothing to Reconcile" name="171" widget="list_button" type="action"/>
<button string="Reconcile" name="%(action_view_account_move_line_reconcile)d" widget="list_button" type="action"/>
<button string="Nothing to Reconcile" name="%(action_account_unreconcile)d" widget="list_button" type="action"/>
<field name="reconciliation_progress" widget="progressbar"/>
</div>
</form>