[IMP] progress bar precentage count and added action on button
bzr revid: rgaopenerp-20120704070356-35czqiavzjb1n0y1
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user