Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

l10n_it_vat_registries: i test falliscono a cavallo della mezzanotte #1921

Closed
2 tasks done
eLBati opened this issue Oct 15, 2020 · 2 comments
Closed
2 tasks done

l10n_it_vat_registries: i test falliscono a cavallo della mezzanotte #1921

eLBati opened this issue Oct 15, 2020 · 2 comments

Comments

@eLBati
Copy link
Member

eLBati commented Oct 15, 2020

Versioni coinvolte:

Passi per riprodurre:

Lanciare una build travis a cavallo della mezzanotte

Comportamento osservato:

I test di l10n_it_vat_registries falliscono con

 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: ERROR: test_invoice_and_report (odoo.addons.l10n_it_vat_registries.tests.test_registry.TestRegistry)
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: Traceback (most recent call last):
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `   File "/home/travis/build/OCA/l10n-italy/l10n_it_vat_registries/tests/test_registry.py", line 67, in test_invoice_and_report
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `     res = wizard.print_registro()
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `   File "/home/travis/build/OCA/l10n-italy/l10n_it_vat_registries/wizard/print_registro_iva.py", line 75, in print_registro
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `     move_ids = self._get_move_ids(wizard)
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `   File "/home/travis/build/OCA/l10n-italy/l10n_it_vat_registries/wizard/print_registro_iva.py", line 64, in _get_move_ids
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: `     raise UserError(_('No documents found in the current selection'))
 ERROR openerp_test odoo.addons.l10n_it_vat_registries.tests.test_registry: ` odoo.exceptions.UserError: ('No documents found in the current selection', '')

Probabilmente perchè i test sono partiti prima di mezzanotte, quindi hanno creato fatture il giorno prima del lancio del registro IVA

@SilvioGregorini
Copy link
Contributor

@eLBati se il problema è che le fatture vengono create prima di mezzanotte mentre la search dentro _get_move_ids viene eseguita dopo, si potrebbe aggiornare la creazione del wizard in tests/test_registry.py da così:

        wizard = self.env['wizard.registro.iva'].create({
            'from_date': fields.Date.today(),
            'to_date': fields.Date.today(),
            'tax_registry_id': tax_registry.id,
            'layout_type': 'supplier',
            'fiscal_page_base': 0,
        })

a così

        wizard = self.env['wizard.registro.iva'].create({
            'from_date': fields.Date.today() - relativedelta(days=1),
            'to_date': fields.Date.today() + relativedelta(days=1),
            'tax_registry_id': tax_registry.id,
            'layout_type': 'supplier',
            'fiscal_page_base': 0,
        })

In questo modo, si potrebbe risolvere il problema (ma magari non mi vengono in mente delle controindicazioni funzionali).

@eLBati
Copy link
Member Author

eLBati commented Mar 14, 2021

Per v12: #2172

@eLBati eLBati closed this as completed Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants