Improve payment view

bzr revid: ced-1e7c420aba0e2ec365ac9569697e41a82ee4e7ed
This commit is contained in:
ced 2007-11-30 09:33:02 +00:00
parent 4b87dcb157
commit 95cfd86e5b
2 changed files with 3 additions and 17 deletions

View File

@ -93,16 +93,6 @@ class payment_order(osv.osv):
res[order.id] = 0.0
return res
def nb_line(self, cr, uid, ids, name, args, context={}):
if not ids: return {}
res= {}.fromkeys(ids,0)
cr.execute("""SELECT "order_id", count(*)
FROM payment_line
WHERE "order_id" in (%s)
GROUP BY "order_id" """ % ','.join(map(str,ids)))
res.update(dict(cr.fetchall()))
return res
_columns = {
'date_planned': fields.date('Scheduled date if fixed'),
'reference': fields.char('Reference',size=128),
@ -116,8 +106,6 @@ class payment_order(osv.osv):
'total': fields.function(_total, string="Total", method=True,
type='float'),
'user_id': fields.many2one('res.users','User',required=True),
'nb_line': fields.function(nb_line,string='Number of payment',
method=True, type='integer'),
'date_prefered': fields.selection([
('now', 'Directly'),
('due', 'Due date'),

View File

@ -67,8 +67,6 @@
<button name="%(wizard_populate_payment)d"
string="Add payment lines" type="action" colspan="2"/>
<field name="line_ids" colspan="4" nolabel="1"/>
<field name="total"/>
<field name="nb_line"/>
<field name="date_created" select="2"/>
<field name="date_done" select="2"/>
<field name="state" select="1" readonly="1"/>
@ -93,7 +91,7 @@
<tree string="Payment order">
<field name="reference" />
<field name="mode"/>
<field name="nb_line" />
<field name="line_ids"/>
<field name="date_planned"/>
<field name="date_created" select="2"/>
<field name="date_done" select="2"/>
@ -175,13 +173,13 @@
on_change="onchange_move_line(move_line_id,parent.mode)"
domain="[('reconcile_id', '=', False), ('credit', '>', 0), ('amount_to_pay', '>', 0)]"/>
<field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
<field name="amount_currency" sum="Amount Total"/>
<field name="amount_currency"/>
<field name="to_pay_currency"/>
<field name="currency"/>
<field name="partner_id"/>
<field name="reference"/>
<field name="due_date"/>
<field name="amount"/>
<field name="amount" sum="Amount Total"/>
<field name="to_pay"/>
<field name="partner_payable"/>
<field name="date_created"/>