Code review comment for lp:~camptocamp/openobject-addons/trunk-addons-account-reversal

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Other One.

In lines 182:

+ move_ids = context['active_ids']

If you use this method from other context this will fail, we avoid as a good proctice iter a dic with Square brackets, we can change:

+ move_ids = context.get('active_ids', False)
+ if not move_ids:
+ raise Controlled message!

The GTK client in some situations doesn't send this key and it fail ugly ;-)

It is happening here too!

187 + cr, uid,
188 + move_ids,
189 + form['date'],
190 + reversal_period_id=period_id,
191 + reversal_journal_id=journal_id,
192 + move_prefix=form['move_prefix'],
193 + move_line_prefix=form['move_line_prefix'],
194 + context=context)

Thanks....

For me it is approved already, im just helping to improve in a technical better way, to avoid unespected Exceptions.

« Back to merge proposal