The bug can also occur when generating a new opening balance. The main problem is that the selection for currency accounts can result in records with a not null currency, but a null amount.
The solution is to change the selection in account.py (lines may have changed):
1526 #adjust also the amount in currency if needed
1527 cr.execute("select currency_id, sum(amount_currency) as amount_currency from account_move_line where move_id = %s and currency_id is not null and amount_currency is not null group by currency_id", (move.id,))
1528 for row in cr.dictfetchall():
1529 currency_id = currency_obj.browse(cr, uid, row['currency_id'], context=context)
1530 if not currency_obj.is_zero(cr, uid, currency_id, row['amount_currency']):
1531 amount_currency = row['amount_currency'] * -1
In the above fragment I added " and amount_currency is not null" to line 1527. I will create a merge request for 6.1. maybe later for 7.0 as I think it will have the same problems.
Crash report:
Server Traceback (most recent call last):
File "/home/oerttrprd61/openerp-web/addons/web/common/http.py", line
593, in send
The bug can also occur when generating a new opening balance. The main problem is that the selection for currency accounts can result in records with a not null currency, but a null amount.
The solution is to change the selection in account.py (lines may have changed):
1526 #adjust also the amount in currency if needed currency) as amount_currency from account_move_line where move_id = %s and currency_id is not null and amount_currency is not null group by currency_id", (move.id,)) obj.browse( cr, uid, row['currency_id'], context=context) obj.is_ zero(cr, uid, currency_id, row['amount_ currency' ]): currency' ] * -1
1527 cr.execute("select currency_id, sum(amount_
1528 for row in cr.dictfetchall():
1529 currency_id = currency_
1530 if not currency_
1531 amount_currency = row['amount_
In the above fragment I added " and amount_currency is not null" to line 1527. I will create a merge request for 6.1. maybe later for 7.0 as I think it will have the same problems.
Crash report:
Server Traceback (most recent call last):
File "/home/ oerttrprd61/ openerp- web/addons/ web/common/ http.py" , line
593, in send
return openerp. netsvc. dispatch_ rpc(service_ name, method, args)
File "/home/ oerttrprd61/ bzr/openobject- server/ openerp/ netsvc. py", line
360, in dispatch_rpc
result = ExportService. getService( service_ name).dispatch( method, params)
File oerttrprd61/ bzr/openobject- server/ openerp/ service/ web_services. py",
"/home/
line 586, in dispatch
res = fn(db, uid, *params)
File "/home/ oerttrprd61/ bzr/openobject- server/ openerp/ osv/osv. py",
line 186, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/ oerttrprd61/ bzr/openobject- server/ openerp/ osv/osv. py",
line 129, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/ oerttrprd61/ bzr/openobject- server/ openerp/ osv/osv. py",
line 195, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/ oerttrprd61/ bzr/openobject- server/ openerp/ osv/osv. py",
line 183, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File oerttrprd61/ openobject- addons/ account/ wizard/ account_ fiscalyear_ close.py" ,
"/home/
line 256, in data_save
obj_ acc_move. validate( cr, uid, [move_id], context=context)
File "/home/ oerttrprd61/ openobject- addons/ account/ account. py", line
1635, in validate
self. _centralise( cr, uid, move, 'debit', context=context)
File "/home/ oerttrprd61/ openobject- addons/ account/ account. py", line
1511, in _centralise
}, context)
File oerttrprd61/ openobject- addons/ account/ account_ move_line. py", line
"/home/
1395, in create
tmp = move_obj. validate( cr, uid, [vals['move_id']], context)
File "/home/ oerttrprd61/ openobject- addons/ account/ account. py", line
1635, in validate
self. _centralise( cr, uid, move, 'debit', context=context)
File "/home/ oerttrprd61/ openobject- addons/ account/ account. py", line
1530, in _centralise
if not currency_ obj.is_ zero(cr, uid, currency_id, currency' ]):
row['amount_
File oerttrprd61/ bzr/openobject- server/ openerp/ addons/ base/res/ res_currency. py",
"/home/
line 172, in is_zero
return float_is_ zero(amount, precision_ rounding= currency. rounding)
File oerttrprd61/ bzr/openobject- server/ openerp/ tools/float_ utils.py" ,
"/home/
line 97, in float_is_zero
return abs(float_ round(value, precision_ rounding= epsilon) ) < epsilon
File oerttrprd61/ bzr/openobject- server/ openerp/ tools/float_ utils.py" ,
"/home/
line 66, in float_round
normalized_ value = value / rounding_factor # normalize
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'