[IMP] improve view for supplier payment and write checks.

bzr revid: nco@tinyerp.com-20120626054114-nh23jv8dyu98areu
This commit is contained in:
Nimesh (Open ERP) 2012-06-26 11:11:14 +05:30
parent 37dc334f0c
commit 20a04f01de
3 changed files with 7 additions and 12 deletions

View File

@ -96,9 +96,9 @@
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
</tree>
</field>
<group class="oe_subtotal_footer">
<field name="amount_total" class="oe_subtotal_footer_separator"/>
</group>
<group class="oe_subtotal_footer oe_right">
<field name="amount_line_total" class="oe_subtotal_footer_separator"/>
</group>
<group>
<group string="Internal Notes">
<field name="narration" colspan="2" nolabel="1"/>
@ -154,7 +154,6 @@
</sheet>
</form>
</field>
</record>
<record id="action_write_check" model="ir.actions.act_window">

View File

@ -247,16 +247,12 @@ class account_voucher(osv.osv):
rate = voucher_rate * company_currency_rate
res[voucher.id] = voucher.amount / rate
return res
def _amount_all(self, cr, uid, ids, name, args, context=None):
print ids, "\n name ",name, "\n args ::> ", args, "\n context ::> ",context
def _amount_total(self, cr, uid, ids, name, args, context=None):
res = {}
amount = 0.0
for voucher in self.browse(cr, uid, ids, context=context):
print "voucher :> ",voucher
for line in voucher.line_dr_ids:
print "line :> ",line
amount += line.amount
print "amount ::>> ",amount
res[voucher.id] = amount
return res
_name = 'account.voucher'
@ -323,7 +319,7 @@ class account_voucher(osv.osv):
help='The specific rate that will be used, in this voucher, between the selected currency (in \'Payment Rate Currency\' field) and the voucher currency.'),
'paid_amount_in_company_currency': fields.function(_paid_amount_in_company_currency, string='Paid Amount in Company Currency', type='float', readonly=True),
'is_multi_currency': fields.boolean('Multi Currency Voucher', help='Fields with internal purpose only that depicts if the voucher is a multi currency one or not'),
'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Invoice Total'),
'amount_line_total': fields.function(_amount_total, digits_compute=dp.get_precision('Account'), string='Invoice Total'),
}
_defaults = {
'period_id': _get_period,

View File

@ -206,8 +206,8 @@
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
</tree>
</field>
<group class="oe_subtotal_footer">
<field name="amount_total" class="oe_subtotal_footer_separator"/>
<group class="oe_subtotal_footer oe_right">
<field name="amount_line_total" class="oe_subtotal_footer_separator"/>
</group>
<group>
<group string="Internal Notes">