[FIX] account_voucher: fixed yaml test in order to reflect what the client are really sending as information

bzr revid: qdp-launchpad@openerp.com-20121019110720-xhkhzd04caczsz41
This commit is contained in:
Quentin (OpenERP) 2012-10-19 13:07:20 +02:00
parent 4b426887ff
commit 8ca8f50656
4 changed files with 5 additions and 4 deletions

View File

@ -1422,7 +1422,7 @@ class account_voucher_line(osv.osv):
}
def onchange_reconcile(self, cr, uid, ids, reconcile, amount, amount_unreconciled, context=None):
vals = { 'amount': 0.0}
vals = {'amount': 0.0}
if reconcile:
vals = { 'amount': amount_unreconciled}
return {'value': vals}

View File

@ -53,7 +53,6 @@
account_id: account.cash
amount: 1000.0
company_id: base.main_company
currency_id: base.EUR
journal_id: account.bank_journal
name: Voucher Axelor
narration: PC Assemble SC234

View File

@ -45,7 +45,6 @@
'account_id': ref('account.cash'),
'amount': 450.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
'partner_id': ref('base.res_partner_19'),
'period_id': ref('account.period_8'),
@ -53,6 +52,10 @@
}
if not res['value']['line_cr_ids']:
res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
#clients aren't sending value of readonly fields in the view, and there is a good reason for that, so here the
#create should only use values of fields that are not readonly. That's why i'm removing some of these values
del(res['value']['line_cr_ids'][0]['date_original'])
del(res['value']['line_cr_ids'][0]['date_due'])
res['value']['line_cr_ids'][0]['amount'] = 450.0
vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
id = self.create(cr, uid, vals)

View File

@ -53,7 +53,6 @@
'account_id': ref('account.cash'),
'amount': 30000.0,
'company_id': ref('base.main_company'),
'currency_id': ref('base.EUR'),
'journal_id': ref('account.bank_journal'),
'partner_id': ref('base.res_partner_19'),
'period_id': ref('account.period_8'),