Skip to content

Commit

Permalink
FIX l10n_it_ricevute_bancarie tests (OCA#336)
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 authored and SirAionTech committed Sep 28, 2023
1 parent 2fc2162 commit 07f5aa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions l10n_it_ricevute_bancarie/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Stefano <stefano.sforzi@agilebg.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-12 02:40+0000\n"
"PO-Revision-Date: 2017-05-12 02:40+0000\n"
"Last-Translator: Stefano <stefano.sforzi@agilebg.com>, 2017\n"
"POT-Creation-Date: 2017-05-22 16:47+0000\n"
"PO-Revision-Date: 2017-05-22 16:47+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -534,7 +533,7 @@ msgid "Invoice entries"
msgstr "Registrazioni fattura"

#. module: l10n_it_ricevute_bancarie
#: code:addons/l10n_it_ricevute_bancarie/models/account/account.py:233
#: code:addons/l10n_it_ricevute_bancarie/models/account/account.py:234
#, python-format
msgid "Invoice is linked to RI.BA. list nr {riba}"
msgstr "La fattura è inserita nella distinta RI.BA. n. {riba}"
Expand Down
3 changes: 2 additions & 1 deletion l10n_it_ricevute_bancarie/models/account/account.py
Original file line number Diff line number Diff line change
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 07f5aa1

Please sign in to comment.