[6.1] Voucher with no currency_id
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
Hello,
Here are my current revision numbers:
$ bzr revno addons
5234
$ bzr revno server
3666
In a yaml test that was properly working on previous versions in our l10n_ch module, I get this output.
[2011-09-28 06:53:16,
Traceback (most recent call last):
File ".../server/
self.
File ".../server/
self.
File ".../server/
unsafe_
File ".../addons/
address_
File ".../addons/
}, context=context)
File ".../server/
self.
File ".../server/
if not fun(self, cr, uid, ids):
File ".../addons/
if not self.pool.
File ".../server/
return abs(self.round(cr, uid, currency, amount)) < currency.rounding
File ".../server/
return round(amount / currency.rounding) * currency.rounding
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
[2011-09-28 06:53:16,
Traceback (most recent call last):
File ".../server/
_load_data(cr, module_name, idref, mode, 'test')
File ".../server/
tools.
File ".../server/
yaml_
File ".../server/
self.
File ".../server/
self.
File ".../server/
unsafe_
File ".../addons/
address_
File ".../addons/
}, context=context)
File ".../server/
self.
File ".../server/
if not fun(self, cr, uid, ids):
File ".../addons/
if not self.pool.
File ".../server/
return abs(self.round(cr, uid, currency, amount)) < currency.rounding
File ".../server/
return round(amount / currency.rounding) * currency.rounding
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
Here is the part of my test generating this error:
-
I import the payment line
-
!python {model: account.
wiz_id = self.create(
wiz = self.browse(cr, uid, wiz_id)
line_obj = self.pool.
pay_line_ids = line_obj.search(cr, uid, [('communicatio
data = { 'lines': [(6, 0, [pay_line_
wiz.write(data)
context[
context[
self.
Somehow, a voucher is generated without a proper currency_id. It's value is False.
Here is the full yaml test, but this is only designed for l10n_ch module.
http://
And as this merge is still pending it might not be fully applicable with current version of l10n_ch (because some fix need to be done and it could crash before this state). However, it is not normal that a voucher got no currency_id when using the populate_statement method and fails to compute the rounding of an amount.
My guess is that the issue is on the voucher level when creating it. Weither a check is missing to raise an error, or the currency_id is not set correctly by default. Shouldn't it takes the company currency ?
Best regards,
Yannick
Hello Yannick Vaucher,
I have applied same .yml file as you have specified in your specification but I didn't face any problem at my end.
Would you please checked again and informed us where you faced the problem.
Thanks and waiting for your reply.