~new-report-intrastat-team/new-report-intrastat/6.1

« back to all changes in this revision

Viewing changes to l10n_fr_intrastat_product/intrastat_product.py

  • Committer: Alexis de Lattre
  • Date: 2012-03-14 22:00:02 UTC
  • Revision ID: alexis@via.ecp.fr-20120314220002-qzlf4izdcunzi512
Fixes bug 955065 : don't declare DEB lines with value = 0

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
 
380
380
        for line_to_create in lines_to_create:
381
381
            line_to_create['partner_vat'] = parent_values['partner_vat_to_write']
382
 
            for value in ['quantity', 'weight', 'amount_company_currency', 'amount_invoice_currency']:
 
382
            line_to_create['amount_company_currency'] = int(round(line_to_create['amount_company_currency']))
 
383
            if line_to_create['amount_company_currency'] == 0:
 
384
                # p20 of the BOD : lines with value rounded to 0 mustn't be declared
 
385
                continue
 
386
            for value in ['quantity', 'weight']: # These 2 fields are char
383
387
                if line_to_create[value]:
384
388
                    line_to_create[value] = str(int(round(line_to_create[value], 0)))
 
389
            line_to_create['amount_invoice_currency'] = int(round(line_to_create['amount_invoice_currency']))
385
390
            line_obj.create(cr, uid, line_to_create, context=context)
386
391
 
387
392
        return True