Forum

Benvenuto!

Questo è il forum ufficiale dell'Associazione Odoo Italia. Dopo esserti registrato potrai partecipare ponendo domande o rispondendo a quelle esistenti. Non scordarti di compilare il tuo profilo e consultare le linee guida prima di iniziare a scrivere.

0

ITA - Fattura elettronica - Ricezione l10n_it_fatturapa_in: importazione delle fatture

Avatar
Massimiliano

Ciao

vorrei sapere se con Odoo 14 qualcuno di voi ha importato fatture on il modulo in oggetto

Nella guida dice:

  • Andare in Contabilità → Acquisti → Fattura elettronica
  • Caricare un file XML
  • Visualizzare il contenuto della fattura facendo clic su “Mostra anteprima”
  • Eseguire la procedura guidata “Importa e-fattura” per creare una fattura in bozza oppure “Collega a fattura esistente” per collegare il file XML a una fattura già (automaticamente) creata



Avatar
Abbandona
5 Risposte
0
Avatar
vittorio tomasi
Migliore risposta

io l'ho fatto ieri e funziona correttamente. Dal Menu Fornitori>File e-fatture in ingresso.

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

Ma funziona anche dal menu Clienti->Fattura cliente -> Carica?

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

Però quelle emesse (Cliente-> Fatture cliente->Carica) non va.


Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/odoo/odoo-server/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 360, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 913, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 532, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1389, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/addons/account/models/account_journal.py", line 619, in create_invoice_from_attachment
    invoice.with_context(no_new_invoice=True).message_post(attachment_ids=[attachment.id])
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 1829, in message_post
    record_name = record_name or self.display_name
  File "/odoo/odoo-server/odoo/fields.py", line 1021, in __get__
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1177, in compute_value
    records._compute_field_value(self)
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/odoo/odoo-server/odoo/models.py", line 4062, in _compute_field_value
    getattr(self, field.compute)()
  File "/odoo/odoo-server/odoo/models.py", line 1728, in _compute_display_name
    names = dict(self.name_get())
  File "/opt/odoo/addons/l10n-italy/l10n_it_fatturapa_in/models/account.py", line 251, in name_get
    result = super(AccountInvoice, self).name_get()
  File "/odoo/odoo-server/addons/account/models/account_move.py", line 2048, in name_get
    name = move._get_move_display_name(show_ref=True)
  File "/odoo/odoo-server/addons/account/models/account_move.py", line 2258, in _get_move_display_name
    draft_name += {
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
KeyError: 'other'
Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

Mi da questo errore:

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
xmlschema.exceptions.XMLSchemaKeyError: "the namespace 'http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fattura/messaggi/v1.0' is not loaded"
Avatar
Abbandona
0
Avatar
vittorio tomasi
Migliore risposta

Forse ti manca qualche modulo python? Prova pip3 install PyXB

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

non va questo è il trace completo

Odoo Server Error
Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/odoo/odoo-server/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 360, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 913, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 532, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1389, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/odoo/models.py", line 6249, in onchange
    todo = [
  File "/odoo/odoo-server/odoo/models.py", line 6252, in <listcomp>
    if name not in done and snapshot0.has_changed(name)
  File "/odoo/odoo-server/odoo/models.py", line 6069, in has_changed
    return self[name] != record[name]
  File "/odoo/odoo-server/odoo/models.py", line 5667, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/odoo/odoo-server/odoo/fields.py", line 2485, in __get__
    return super().__get__(records, owner)
  File "/odoo/odoo-server/odoo/fields.py", line 969, in __get__
    self.recompute(record)
  File "/odoo/odoo-server/odoo/fields.py", line 1155, in recompute
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1177, in compute_value
    records._compute_field_value(self)
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/odoo/odoo-server/odoo/models.py", line 4062, in _compute_field_value
    getattr(self, field.compute)()
  File "/opt/odoo/addons/l10n-italy/l10n_it_fatturapa_in/models/attachment.py", line 100, in _compute_xml_data
    fatt = wiz_obj.get_invoice_obj(att)
  File "/opt/odoo/addons/l10n-italy/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py", line 1652, in get_invoice_obj
    return efattura.CreateFromDocument(xml_string)
  File "/opt/odoo/addons/l10n-italy/l10n_it_fatturapa_in/wizard/efattura.py", line 240, in CreateFromDocument
    validat = validator.to_dict(tree, dict_class=ObjectDict)
  File "/usr/local/lib/python3.8/dist-packages/xmlschema/validators/schemas.py", line 1994, in decode
    for result in self.iter_decode(source, path, schema_path, validation, *args, **kwargs):
  File "/usr/local/lib/python3.8/dist-packages/xmlschema/validators/schemas.py", line 1925, in iter_decode
    schema = self.get_schema(namespace)
  File "/usr/local/lib/python3.8/dist-packages/xmlschema/validators/schemas.py", line 1081, in get_schema
    raise XMLSchemaKeyError('the namespace {!r} is not loaded'.format(namespace)) from None
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
xmlschema.exceptions.XMLSchemaKeyError: "the namespace 'http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fattura/messaggi/v1.0' is not loaded"

Avatar
Abbandona
0
Avatar
Alex Comba
Migliore risposta

In generale per questo tipo di segnalazioni il forum è poco indicato, è preferibile aprire una issue su https://github.com/OCA/l10n-italy/issues/new/choose scegliendo il template Bug report.

Prima di farlo però è importante assicurarsi che il problema sia riproducibile su https://runbot.odoo-community.org/runbot/repo/https-github-com-oca-l10n-italy-122.

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

Grazie Alex,

ho provato ad importarla su questo e va:
https://runbot.odoo-community.org/runbot/repo/https-github-com-oca-l10n-italy-122

Come mi consigli di procedere nell'analisi?

Grazie

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

questo è l'errore:
Errore:
Odoo Server Error

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/odoo/odoo-server/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/odoo/odoo-server/odoo/http.py", line 360, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/odoo/odoo-server/odoo/http.py", line 348, in checked_call
    result = self.endpoint(*a, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 913, in __call__
    return self.method(*args, **kw)
  File "/odoo/odoo-server/odoo/http.py", line 532, in response_wrap
    response = f(*args, **kw)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1389, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 399, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/odoo/odoo-server/odoo/api.py", line 386, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/odoo/odoo-server/addons/account/models/account_journal.py", line 619, in create_invoice_from_attachment
    invoice.with_context(no_new_invoice=True).message_post(attachment_ids=[attachment.id])
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 1829, in message_post
    record_name = record_name or self.display_name
  File "/odoo/odoo-server/odoo/fields.py", line 1021, in __get__
    self.compute_value(recs)
  File "/odoo/odoo-server/odoo/fields.py", line 1177, in compute_value
    records._compute_field_value(self)
  File "/odoo/odoo-server/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/odoo/odoo-server/odoo/models.py", line 4062, in _compute_field_value
    getattr(self, field.compute)()
  File "/odoo/odoo-server/odoo/models.py", line 1728, in _compute_display_name
    names = dict(self.name_get())
  File "/opt/odoo/addons/l10n-italy/l10n_it_fatturapa_in/models/account.py", line 251, in name_get
    result = super(AccountInvoice, self).name_get()
  File "/odoo/odoo-server/addons/account/models/account_move.py", line 2048, in name_get
    name = move._get_move_display_name(show_ref=True)
  File "/odoo/odoo-server/addons/account/models/account_move.py", line 2258, in _get_move_display_name
    draft_name += {
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/odoo/odoo-server/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/odoo/odoo-server/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
KeyError: 'other'

Avatar
Abbandona
0
Avatar
Alex Comba
Migliore risposta

In prima battuta mi assicurerei di avere il codice aggiornato sia di Odoo che di https://github.com/OCA/l10n-italy.

Avatar
Abbandona
0
Avatar
Massimiliano
Migliore risposta

L'ho scaricato 2 giorni fa :-(

Avatar
Abbandona
0
Avatar
Alex Comba
Migliore risposta

Nella 14.0 PyXB è stato sostituito con xmlschema. (vedi link).

Avatar
Abbandona