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

[10] Errore importazione XML fattura elettronica: Attempt to reference unrecognized attribute SistemaEmittente

Avatar
trigg3r

L'importazione del file XML di una fattura elettronica genera questo errore:


Traceback (most recent call last):
  File "/<odoo server path>/odoo/http.py", line 642, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/<odoo server path>/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/<odoo server path>/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/<odoo server path>/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/<odoo server path>/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/<odoo server path>/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/<odoo server path>/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/<odoo server path>/addons/web/controllers/main.py", line 895, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/<odoo server path>/addons/web/controllers/main.py", line 887, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/<odoo server path>/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/<odoo server path>/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/<odoo server path>/addons/mail/models/mail_thread.py", line 228, in create
    thread = super(MailThread, self).create(values)
  File "/<odoo server path>/odoo/models.py", line 3846, in create
    record = self.browse(self._create(old_vals))
  File "/<odoo server path>/odoo/models.py", line 4005, in _create
    self.recompute()
  File "/<odoo server path>/odoo/models.py", line 5340, in recompute
    vals = rec._convert_to_write({n: rec[n] for n in ns})
  File "/<odoo server path>/odoo/models.py", line 5340, in <dictcomp>
    vals = rec._convert_to_write({n: rec[n] for n in ns})
  File "/<odoo server path>/odoo/models.py", line 5236, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/<odoo server path>/odoo/fields.py", line 915, in __get__
    self.determine_value(record)
  File "/<odoo server path>/odoo/fields.py", line 1001, in determine_value
    self.compute_value(recs)
  File "/<odoo server path>/odoo/fields.py", line 981, in compute_value
    self._compute_value(records)
  File "/<odoo server path>/odoo/fields.py", line 972, in _compute_value
    getattr(records, self.compute)()
  File "/<odoo addons path>/l10n-italy/l10n_it_fatturapa_in/models/attachment.py", line 52, in _compute_xml_data
    fatt = self.env['wizard.import.fatturapa'].get_invoice_obj(att)
  File "/<odoo addons path>/l10n-italy/l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py", line 1179, in get_invoice_obj
    return fatturapa_v_1_2.CreateFromDocument(xml_string)
  File "/<odoo addons path>/l10n-italy/l10n_it_fatturapa/bindings/fatturapa_v_1_2.py", line 68, in CreateFromDocument
    saxer.parse(io.BytesIO(xmld))
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 213, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/xml/sax/expatreader.py", line 354, in start_element_ns
    AttributesNSImpl(newattrs, qnames))
  File "/<odoo venv path>/local/lib/python2.7/site-packages/pyxb/binding/saxer.py", line 370, in startElementNS
    binding_object = this_state.startBindingElement(type_class, new_object_factory, element_decl, attrs)
  File "/<odoo venv path>/local/lib/python2.7/site-packages/pyxb/binding/saxer.py", line 207, in startBindingElement
    self.__constructElement(new_object_factory, attrs)
  File "/<odoo venv path>/local/lib/python2.7/site-packages/pyxb/binding/saxer.py", line 135, in __constructElement
    self.__bindingInstance._setAttribute(attr_en, attrs.getValue(attr_name))
  File "/<odoo venv path>/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2270, in _setAttribute
    raise pyxb.UnrecognizedAttributeError(type(self), attr_en, self)
UnrecognizedAttributeError: Attempt to reference unrecognized attribute SistemaEmittente in type <class 'odoo.addons.l10n_it_fatturapa.bindings.fatturapa_v_1_2.FatturaElettronicaType'>

(riporto su GitHub?)

Avatar
Abbandona
1 risposta
2
Avatar
Alex Comba
Migliore risposta

Ciao,

il SistemaEmittente è un attributo introdotto nel nuovo tracciato XML della fattura elettronica versione 1.6.

La PR per la versione 10.0 è ancora in fase di sviluppo e la puoi trovare qui: https://github.com/OCA/l10n-italy/pull/1986

Avatar
Abbandona
0
Avatar
trigg3r
Migliore risposta

Grazie Alex

Avatar
Abbandona