Skip to content

Commit

Permalink
[FIX] foreign partner e-inv enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
primes2h committed Mar 1, 2019
1 parent 9cd10f9 commit bbf4f2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion l10n_it_fatturapa/__manifest__.py
Expand Up @@ -5,7 +5,7 @@

{
'name': 'Italian Localization - Fattura elettronica - Base',
'version': '12.0.1.3.0',
'version': '12.0.1.3.1',
'category': 'Localization/Italy',
'summary': 'Fatture elettroniche',
'author': 'Davide Corio, Agile Business Group, Innoviu, '
Expand Down
7 changes: 3 additions & 4 deletions l10n_it_fatturapa/models/partner.py
Expand Up @@ -32,8 +32,7 @@ class ResPartner(models.Model):
help="The code, 7 characters long, assigned by ES to subjects with an "
"accredited channel; if the addressee didn't accredit a channel "
"to ES and invoices are received by PEC, the field must be "
"filled with zeros ('0000000').",
default='0000000')
"filled with zeros ('0000000').")
# 1.1.6
pec_destinatario = fields.Char(
"Addressee PEC",
Expand Down Expand Up @@ -111,8 +110,8 @@ def _check_ftpa_partner_data(self):
' generation.'
) % partner.name)

@api.onchange('country_id')
def onchange_country_id_e_inv(self):
@api.onchange('country_id', 'electronic_invoice_subjected')
def onchange_partner_codice_destinatario(self):
if self.country_id.code == 'IT':
self.codice_destinatario = '0000000'
else:
Expand Down
Expand Up @@ -360,7 +360,7 @@ def test_9_xml_export(self):
self.tax_22.price_include = True
self.set_sequences(9, 18, '2018-01-07')
partner = self.res_partner_fatturapa_4
partner.onchange_country_id_e_inv()
partner.onchange_partner_codice_destinatario()
partner.write(partner._convert_to_write(partner._cache))
self.assertEqual(partner.codice_destinatario, 'XXXXXXX')
invoice = self.invoice_model.create({
Expand Down

0 comments on commit bbf4f2d

Please sign in to comment.