Skip to content

Commit

Permalink
[FIX] l10n_it_reverse_charge: added check for invoice of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoRubi authored and TheMule71 committed Jun 6, 2021
1 parent 88e9e33 commit 862f8ec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 133 deletions.
2 changes: 0 additions & 2 deletions l10n_it_reverse_charge/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
'views/account_invoice_view.xml',
'views/account_fiscal_position_view.xml',
'views/account_rc_type_view.xml',

],
'demo': ['demo/reverse_charge_demo.yml'],
'installable': True,
}
29 changes: 0 additions & 29 deletions l10n_it_reverse_charge/demo/reverse_charge_demo.yml

This file was deleted.

11 changes: 5 additions & 6 deletions l10n_it_reverse_charge/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# Copyright 2017 Marco Calcagni - Dinamiche Aziendali srl
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

#### questo è in working process
#### tutti gli altri models sono ok compresi gli xml

from odoo import api, fields, models
from odoo.exceptions import Warning as UserError
from odoo.tools.translate import _
Expand Down Expand Up @@ -38,7 +35,7 @@ class AccountInvoice(models.Model):
comodel_name='account.invoice',
string='RC Self Purchase Invoice', copy=False, readonly=True)

def rc_inv_line_vals(self, line): ## ok verificata
def rc_inv_line_vals(self, line):
return {
'product_id': line.product_id.id,
'name': line.name,
Expand All @@ -59,6 +56,7 @@ def rc_inv_vals(self, partner, account, rc_type, lines):
'origin': self.number,
'rc_purchase_invoice_id': self.id,
'name': rc_type.self_invoice_text,
'fiscal_position_id': None
}

def get_inv_line_to_reconcile(self):
Expand Down Expand Up @@ -216,7 +214,7 @@ def reconcile_rc_invoice(self, rc_payment):
rc_payment_line_to_reconcile.id])
rc_lines_to_rec.reconcile()

def generate_self_invoice(self): ###
def generate_self_invoice(self):

rc_type = self.fiscal_position_id.rc_type_id
if not rc_type.payment_journal_id.default_credit_account_id:
Expand Down Expand Up @@ -313,7 +311,8 @@ def invoice_validate(self):
res = super(AccountInvoice, self).invoice_validate()
fp = self.fiscal_position_id
rc_type = fp and fp.rc_type_id
if rc_type and rc_type.method == 'selfinvoice':
if rc_type and rc_type.method == 'selfinvoice'\
and self.amount_total:
if not rc_type.with_supplier_self_invoice:
self.generate_self_invoice()
else:
Expand Down
8 changes: 0 additions & 8 deletions l10n_it_reverse_charge/tests/__init__.py

This file was deleted.

88 changes: 0 additions & 88 deletions l10n_it_reverse_charge/tests/test_rc.py

This file was deleted.

0 comments on commit 862f8ec

Please sign in to comment.