[FIX] account_voucher: better voucher payment screen
revert commit 9310 with incorrect writeoff amount hide writeoff reconcilation fields when no price difference hide analytic_id (Write-Off Analytic Account) when not with_writeoff bzr revid: mat@openerp.com-20130724094023-fbd1hqwe9hdh28id
This commit is contained in:
parent
634fef80ef
commit
30f07ee98d
|
@ -236,9 +236,9 @@ class account_voucher(osv.osv):
|
|||
debit = credit = 0.0
|
||||
sign = type == 'payment' and -1 or 1
|
||||
for l in line_dr_ids:
|
||||
debit += l['amount_unreconciled']
|
||||
debit += l['amount']
|
||||
for l in line_cr_ids:
|
||||
credit += l['amount_unreconciled']
|
||||
credit += l['amount']
|
||||
return amount - sign * (credit - debit)
|
||||
|
||||
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, type, context=None):
|
||||
|
@ -1298,10 +1298,8 @@ class account_voucher(osv.osv):
|
|||
}
|
||||
new_id = move_line_obj.create(cr, uid, move_line_foreign_currency, context=context)
|
||||
rec_ids.append(new_id)
|
||||
|
||||
if line.move_line_id.id:
|
||||
rec_lst_ids.append(rec_ids)
|
||||
|
||||
return (tot_line, rec_lst_ids)
|
||||
|
||||
def writeoff_move_line_get(self, cr, uid, voucher_id, line_total, move_id, name, company_currency, current_currency, context=None):
|
||||
|
|
|
@ -332,14 +332,15 @@
|
|||
<group>
|
||||
<group>
|
||||
<field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="payment_option" required="1"/>
|
||||
<field name="payment_option" required="1" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','other')]"/>
|
||||
<field name="comment"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
|
||||
<field name="analytic_id"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
groups="analytic.group_analytic_accounting"
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
</group>
|
||||
|
@ -494,14 +495,15 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="writeoff_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="payment_option" required="1"/>
|
||||
<field name="payment_option" required="1" attrs="{'invisible':[('writeoff_amount','=',0)]}"/>
|
||||
<field name="writeoff_acc_id"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)], 'required':[('payment_option','=','with_writeoff')]}"
|
||||
domain="[('type','=','other')]"/>
|
||||
<field name="comment"
|
||||
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
|
||||
<field name="analytic_id"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
groups="analytic.group_analytic_accounting"
|
||||
attrs="{'invisible':['|', ('payment_option','!=','with_writeoff'), ('writeoff_amount','=',0)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
|
Loading…
Reference in New Issue