l10n_it_vat_registries : Divisione per zero causata da IVA non detraibile

Bug #1168323 reported by yayo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Italia
Fix Released
Undecided
Unassigned

Bug Description

Discussione Forum da cui è partito il bug: http://www.openerp-italia.org/index.php/kunena/29-moduli/10974-webkit-errore-nella-stampa-dei-registri-iva

Il bug (sembra) che si presenti per i valori di iva indetraibile (anche se non ne sono convinto) .... L'errore riportato è:

<code>
Traceback (most recent call last):
File "/opt/openerp/6/openerp/openerp/addons/report_webkit/webkit_report.py", line 258, in create_single_pdf
**self.parser_instance.localcontext)
File "/usr/lib/python2.6/site-packages/mako/template.py", line 189, in render
return runtime._render(self, self.callable_, args, data)
File "/usr/lib/python2.6/site-packages/mako/runtime.py", line 403, in _render
_render_context(template, callable_, context, *args, **_kwargs_for_callable(callable_, data))
File "/usr/lib/python2.6/site-packages/mako/runtime.py", line 434, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python2.6/site-packages/mako/runtime.py", line 457, in _exec_template
callable_(context, *args, **kwargs)
File "memory:0x7fc8b3f0ce50", line 42, in render_body
%for line in tax_lines(object) :
File "/opt/openerp/6/openerp/openerp/addons/l10n_it_vat_registries/invoice.py", line 135, in _get_tax_lines
move_line.tax_amount * 100.0) / actual_tax_amount)
ZeroDivisionError: float division
</code>

Related branches

Revision history for this message
yayo (jaganz) wrote :

Scusate ma launchpad è una delle cose più brutte che mente umana abbia concepito... continuo qui quello che stavo scrivendo:

Mi sono fatto stampare le variabili interessate:

line.tax_code_id.id 64
main_tax.base_code_id.id 64
self._get_line_amount_with_sign(line) 0.0
main_tax.amount -0,2000
base_amount 0.0
actual_tax_amount -0.0

Il tax code corrisponde nella tabella account_tax:
a: "Iva al 21% indetraibile (D)";
che ha come amount: 0.0000;

Ma ce ne sono altre che hanno 0 ...

Revision history for this message
yayo (jaganz) wrote :

Salve, nessuno può supportarmi per la risoluzione di questo bug? Se volete me lo posso prendere in carico ma ho bisogno di supporto. Il problema al momento permane (e per noi è bloccante)

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Riesci a descrivere i passi precisi per poter riprodurre il problema su un nuovo database?
Grazie

Changed in openobject-italia:
status: New → Incomplete
Revision history for this message
yayo (jaganz) wrote :
Changed in openobject-italia:
status: Incomplete → Confirmed
status: Confirmed → Fix Committed
Revision history for this message
yayo (jaganz) wrote :

la patch è utilizzabile anche sulla 6.1 ? versione che stiamo usando attualmente

Grazie!

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Quel pezzo di codice dovrebbe essere uguale.
Puoi provare a scaricare la patch da
https://code.launchpad.net/~elbati/openobject-italia/7-fix-1168323/+merge/160589/+preview-diff/+files/preview.diff
e applicarla nel tuo branch locale degli addons italiani 6.1

Revision history for this message
yayo (jaganz) wrote :

grazie, patch testata e funzionante (sulla 6.1)

Grazie ancora :)

Changed in openobject-italia:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.