[FIX] account_voucher: now that currency rates created at installation does not use current year (be33101), tests must create their own rates instead of trying to change default one

This commit is contained in:
Christophe Simonis 2015-01-22 17:19:56 +01:00
parent be33101903
commit c75b61d3e7
5 changed files with 22 additions and 30 deletions

View File

@ -13,12 +13,11 @@
- -
I create currency USD in OpenERP for January of 1.333333 Rate I create currency USD in OpenERP for January of 1.333333 Rate
- -
!python {model: res.currency.rate}: | !record {model: res.currency.rate, id: jan_usd}:
from datetime import datetime currency_id: base.USD
curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] name: !eval "'%s-01-01' %(datetime.now().year)"
date = '%s-01-01' %(datetime.now().year) rate: 1.333333
ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)])
self.write(cr, uid, ids, {'rate': 1.333333})
- -
I create currency USD in OpenERP for February of 1.250000 Rate I create currency USD in OpenERP for February of 1.250000 Rate
- -

View File

@ -13,12 +13,11 @@
- -
I create currency USD in OpenERP for January of 1.333333 Rate I create currency USD in OpenERP for January of 1.333333 Rate
- -
!python {model: res.currency.rate}: | !record {model: res.currency.rate, id: jan_usd}:
from datetime import datetime currency_id: base.USD
curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] name: !eval "'%s-01-01' %(datetime.now().year)"
date = '%s-01-01' %(datetime.now().year) rate: 1.333333
ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)])
self.write(cr, uid, ids, {'rate': 1.333333})
- -
I create currency USD in OpenERP for February of 1.250000 Rate I create currency USD in OpenERP for February of 1.250000 Rate
- -

View File

@ -20,12 +20,10 @@
- -
I create currency USD in OpenERP for January of 1.333333 Rate I create currency USD in OpenERP for January of 1.333333 Rate
- -
!python {model: res.currency.rate}: | !record {model: res.currency.rate, id: jan_usd}:
from datetime import datetime currency_id: base.USD
curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] name: !eval "'%s-01-01' %(datetime.now().year)"
date = '%s-01-01' %(datetime.now().year) rate: 1.333333
ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)])
self.write(cr, uid, ids, {'rate': 1.333333})
- -
I create currency USD in OpenERP for February of 1.250000 Rate I create currency USD in OpenERP for February of 1.250000 Rate
- -

View File

@ -20,12 +20,10 @@
- -
I create currency USD in OpenERP for January of 1.333333 Rate I create currency USD in OpenERP for January of 1.333333 Rate
- -
!python {model: res.currency.rate}: | !record {model: res.currency.rate, id: jan_usd}:
from datetime import datetime currency_id: base.USD
curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] name: !eval "'%s-01-01' %(datetime.now().year)"
date = '%s-01-01' %(datetime.now().year) rate: 1.333333
ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)])
self.write(cr, uid, ids, {'rate': 1.333333})
- -
I create currency USD in OpenERP for February of 1.250000 Rate I create currency USD in OpenERP for February of 1.250000 Rate
- -

View File

@ -10,12 +10,10 @@
- -
I update the Currency USD in OpenERP for January with rate 1.200000 I update the Currency USD in OpenERP for January with rate 1.200000
- -
!python {model: res.currency.rate}: | !record {model: res.currency.rate, id: jan_usd}:
from datetime import datetime currency_id: base.USD
curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])[0] name: !eval "'%s-01-01' %(datetime.now().year)"
date = '%s-01-01' %(datetime.now().year) rate: 1.333333
ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)])
self.write(cr, uid, ids, {'rate': 1.200000})
- -
I update the Currency USD in OpenERP for February with rate 1.400000 I update the Currency USD in OpenERP for February with rate 1.400000
- -