Skip to content

Api compat - #24

Merged
rvalyi merged 2 commits into
mainfrom
api-compat
Oct 6, 2026
Merged

rvalyi merged 2 commits into
mainfrom
api-compat

Conversation

@rvalyi

@rvalyi rvalyi commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

📒 Description

compat layer, see commits

🛫 Checklist

  • nfelib-client tests
  • OCA/l10n-brazil tests

FiscalClient.pkcs12_data now accepts raw PFX bytes, a base64 encoded
certificate (the Odoo Binary field form, which nfelib's
CommonMixin.sign_xml passes through erpbrasil.assinatura) or a file
path, normalizing internally to raw bytes for the requests_pkcs12
adapter. The as-given value stays available as pkcs12_data for signing.

This removes the need for callers to know which encoding each consumer
expects (the fake_certificate split-brain the Odoo l10n_br_nfe nfelib
POC had to work around).
nfelib's SOAP clients unwrap nfeResultMsg content into the wrapped
response after the send (response.resposta = ...): the read-only
property aliases broke them. Keep the new field names as canonical and
make the erpbrasil.edoc-style aliases settable.
@antoniospneto

Copy link
Copy Markdown
Contributor

Testando o main contra a nfelib 3.0.0 em homologação na SVRS (pela OCA/l10n-brazil#4147): sem os setters deste PR, a nfelib quebra em toda chamada SOAP com AttributeError: can't set attribute 'resposta'. Isso porque ela faz response.resposta = response.resposta.body.nfeResultMsg.content[0] em nfelib/nfe/client/v4_0/nfe.py:315, e o mesmo padrão aparece em cte, mdfe, dfe e mde. A NF-e chega a ser autorizada na SEFAZ, mas o ERP não recebe o resultado. Como o extra [soap] da nfelib pede brazil-fiscal-client sem versão, este PR precisa entrar antes do próximo release saído do main.

@rvalyi

rvalyi commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Caramba eu achava que eu tivesse mesclado já, mesclando tá ok né?

@rvalyi
rvalyi merged commit eac370d into main Oct 6, 2026
7 checks passed
@ak-git-bot
ak-git-bot deleted the api-compat branch October 6, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants