Skip to content

Commit

Permalink
[FIX] l10n_it_reverse_charge: replace action_cancel_draft by action_i…
Browse files Browse the repository at this point in the history
…nvoice_draft due to odoo/odoo@bc8d5db (OCA#433)

In this way both invoices are again set as draft.
  • Loading branch information
tafaRU authored and SimoneVagile committed Jun 3, 2021
1 parent 89cd6d3 commit 85d063e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion l10n_it_reverse_charge/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{
'name': 'Reverse Charge IVA',
'version': '10.0.1.0.0',
'version': '10.0.1.1.0',
'category': 'Localization/Italy',
'summary': 'Reverse Charge for Italy',
'author': 'Odoo Italia Network,Odoo Community Association (OCA)',
Expand Down
8 changes: 4 additions & 4 deletions l10n_it_reverse_charge/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,16 @@ def action_cancel(self):
return super(AccountInvoice, self).action_cancel()

@api.multi
def action_cancel_draft(self):
super(AccountInvoice, self).action_cancel_draft()
def action_invoice_draft(self):
super(AccountInvoice, self).action_invoice_draft()
invoice_model = self.env['account.invoice']
for inv in self:
if inv.rc_self_invoice_id:
self_invoice = invoice_model.browse(
inv.rc_self_invoice_id.id)
self_invoice.action_cancel_draft()
self_invoice.action_invoice_draft()
if inv.rc_self_purchase_invoice_id:
self_purchase_invoice = invoice_model.browse(
inv.rc_self_purchase_invoice_id.id)
self_purchase_invoice.action_cancel_draft()
self_purchase_invoice.action_invoice_draft()
return True

0 comments on commit 85d063e

Please sign in to comment.