Skip to content

Commit

Permalink
FIX l10n_it_ricevute_bancarie tests
Browse files Browse the repository at this point in the history
after odoo/odoo@efa4f85
otherwise:

2017-05-20 03:21:02,605 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: ERROR: test_delete_due_cost_line (odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba.TestInvoiceDueCost)
2017-05-20 03:21:02,605 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: Traceback (most recent call last):
2017-05-20 03:21:02,605 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `   File "/home/travis/build/OCA/l10n-italy/l10n_it_ricevute_bancarie/tests/test_riba.py", line 205, in test_delete_due_cost_line
2017-05-20 03:21:02,605 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `     self.invoice.action_invoice_draft()
2017-05-20 03:21:02,606 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `   File "/home/travis/build/OCA/l10n-italy/l10n_it_ricevute_bancarie/models/account/account.py", line 213, in action_invoice_draft
2017-05-20 03:21:02,606 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `     line.unlink()
2017-05-20 03:21:02,606 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `   File "/home/travis/odoo-10.0/addons/account/models/account_invoice.py", line 1360, in unlink
2017-05-20 03:21:02,606 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: `     raise UserError(_('You can only delete an invoice line if the invoice is in draft state.'))
2017-05-20 03:21:02,606 6389 ERROR openerp_test odoo.addons.l10n_it_ricevute_bancarie.tests.test_riba: ` UserError: (u'You can only delete an invoice line if the invoice is in draft state.', None)
  • Loading branch information
eLBati committed May 22, 2017
1 parent cc83038 commit 348da9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion l10n_it_ricevute_bancarie/models/account/account.py
Expand Up @@ -207,11 +207,12 @@ def action_move_create(self):
def action_invoice_draft(self):
# ---- Delete Due Cost Line of invoice when set Back to Draft
# ---- line was added on new validate
super(AccountInvoice, self).action_invoice_draft()
for invoice in self:
invoice.refresh()
for line in invoice.invoice_line_ids:
if line.due_cost_line:
line.unlink()
super(AccountInvoice, self).action_invoice_draft()

@api.multi
def action_cancel(self):
Expand Down

0 comments on commit 348da9b

Please sign in to comment.