You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce: Using an spanish certificate in res.company (field -> l10n_es_edi_facturae_certificate_id) returns error none field.
Current behavior: When trying to save the changes you get the error: RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1765, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/home/odoo/src/odoo/17.0/odoo/service/model.py", line 133, in retrying result = func() File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1792, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1996, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_http.py", line 222, in _dispatch result = endpoint(**request.params) File "/home/odoo/src/odoo/17.0/odoo/http.py", line 722, in route_wrapper result = endpoint(self, *args, **params_ok) File "/home/odoo/src/odoo/17.0/addons/web/controllers/dataset.py", line 24, in call_kw return self._call_kw(model, method, args, kwargs) File "/home/odoo/src/odoo/17.0/addons/web/controllers/dataset.py", line 20, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/home/odoo/src/odoo/17.0/odoo/api.py", line 468, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/home/odoo/src/odoo/17.0/odoo/api.py", line 453, in _call_kw_multi result = method(recs, *args, **kwargs) File "/home/odoo/src/odoo/17.0/addons/web/models/models.py", line 73, in web_save self = self.create(vals) File "<decorator-gen-364>", line 2, in create File "/home/odoo/src/odoo/17.0/odoo/api.py", line 414, in _model_create_multi return create(self, [arg]) File "/home/odoo/src/odoo/17.0/addons/l10n_es_edi_facturae/models/l10n_es_edi_facturae_certificate.py", line 54, in create if fields.datetime.now() > certif.not_valid_after: AttributeError: 'NoneType' object has no attribute 'not_valid_after'
Expected behavior: Get the certificate
Others: I have it already working by changing _decode_certificate function in path odoo\addons\l10n_es_edi_facturae\models\l10n_es_edi_facturae_certificate.py
`def _decode_certificate(self):
"""
Return certificate data
:return tuple: private_key, certificate
"""
self.ensure_one()
content, password = b64decode(self.with_context(bin_size=False).content), self.password.encode() if self.password else None
// *_dummy contains the actual certificate in first position and certificate doesn't have it
private_key, certificate, certificates = pkcs12.load_key_and_certificates(content, password, backend=default_backend())
if certificate == None:
return private_key, certificates[0]
else:
return private_key, certificate`
Impacted versions: 17.0
Steps to reproduce: Using an spanish certificate in res.company (field -> l10n_es_edi_facturae_certificate_id) returns error none field.
Current behavior: When trying to save the changes you get the error:
RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1765, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/home/odoo/src/odoo/17.0/odoo/service/model.py", line 133, in retrying result = func() File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1792, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/home/odoo/src/odoo/17.0/odoo/http.py", line 1996, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_http.py", line 222, in _dispatch result = endpoint(**request.params) File "/home/odoo/src/odoo/17.0/odoo/http.py", line 722, in route_wrapper result = endpoint(self, *args, **params_ok) File "/home/odoo/src/odoo/17.0/addons/web/controllers/dataset.py", line 24, in call_kw return self._call_kw(model, method, args, kwargs) File "/home/odoo/src/odoo/17.0/addons/web/controllers/dataset.py", line 20, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/home/odoo/src/odoo/17.0/odoo/api.py", line 468, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/home/odoo/src/odoo/17.0/odoo/api.py", line 453, in _call_kw_multi result = method(recs, *args, **kwargs) File "/home/odoo/src/odoo/17.0/addons/web/models/models.py", line 73, in web_save self = self.create(vals) File "<decorator-gen-364>", line 2, in create File "/home/odoo/src/odoo/17.0/odoo/api.py", line 414, in _model_create_multi return create(self, [arg]) File "/home/odoo/src/odoo/17.0/addons/l10n_es_edi_facturae/models/l10n_es_edi_facturae_certificate.py", line 54, in create if fields.datetime.now() > certif.not_valid_after: AttributeError: 'NoneType' object has no attribute 'not_valid_after'
Expected behavior: Get the certificate
Others: I have it already working by changing
_decode_certificate
function in path odoo\addons\l10n_es_edi_facturae\models\l10n_es_edi_facturae_certificate.py`def _decode_certificate(self):
"""
Return certificate data
I have already publish a pull request at: PR
The text was updated successfully, but these errors were encountered: