-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0][ADD] l10n_br_mdfe: add new module #3445
base: 14.0
Are you sure you want to change the base?
[14.0][ADD] l10n_br_mdfe: add new module #3445
Conversation
Hi @mileo, @renatonlima, @rvalyi, |
@@ -7,13 +7,10 @@ | |||
class MdfeSpecMixin(models.AbstractModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pode renomear o arquivo spec_mixin.py ? Eu fiz isso no PR do multi-esquemas, reflete mais o que tem dentro.
Pois o spec.mixin.schema eh algo que extende TODOS modelos geridos pro XSD, enquanto que o SpecModel e StackedModel sao apenas pro objetos Odoo nativos que tem que ser extendido por algum mixin do esquemas. Ja tem uma certa complexidade entao melhor ajudar com o nome das coisas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2be2b5c
to
cbf090a
Compare
l10n_br_mdfe/hooks.py
Outdated
|
||
def post_init_hook(cr, registry): | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
env["mdfe.30.tmdfe_infnfe"]._register_hook() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu acho que pode tirar isso agora.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@marcelsavegnago o _register_hook não foi chamado pros objetos da mdfe. Esse problema foi depois de vc remover o hook apenas? Ele deveria fazer sozinho mas talvez ele cai naquele problema que eu comentei mais cedo de precisar de um loop para cada esquema no #3431. Para as tabelas desses objetos existirem o _register_hook precisa ser chamado pelo menos uma vez para aquele esquema da mdfe. Normalmente ele deveria fazer sozinho, mas talvez caiu no caso que aquele mro() trouxe apenas as extensões da nfe e que ele parou apenas na primeira extensão "spec" da nfe no caso. Na pior se resolver de chamar o _register_hook em cima de um objeto da mdfe no hook.py, seria um workaround aceitável até fazer aquele loop no spec_driven_model. |
46cbd92
to
a4727ac
Compare
3bbd0a7
to
d9bcf20
Compare
86c8bbe
to
027a274
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcelsavegnago eu tinha errado no summary do manifest do modulo l10n_br_mdfe_spec (ta como CTe). Pode aproveitar para alterar o summary por algo do tipo: "MDF-e abstract models generated by xsdata-odoo from the oficial xsd" ou algo do tipo que achar melhor por favor? (eu acabei de ajustar dessa forma no summary do l10n_br_nfe_spec em #3461)
32a5ba0
to
ad38578
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nos logs eu vi esse warning: "2024-10-21 13:08:15,686 535 WARNING odoo odoo.modules.registry: res.partner: inconsistent 'compute_sudo' for computed fields: mdfe30_CNPJ, mdfe30_idEstrangeiro, mdfe30_CPF, mdfe30_choice6, mdfe30_CEP, mdfe30_fone, mdfe30_IE, mdfe30_choice8, mdfe30_choice9, mdfe30_choice10, mdfe30_choice11, mdfe30_choice12 " Na NFe a gente conseguiu corrigir isso.
Tb é ruim usar esses padrões mdfe30_choiceXY, seria melhor botar um nome mdfe30_choice_<alguma coisa explicita>
assim como foi feito nos campos choice da NFe.
714f1be
to
23879d9
Compare
82c5121
to
f2346a1
Compare
Done |
Done |
9220390
to
1a7defd
Compare
1a7defd
to
29d7794
Compare
29d7794
to
7796978
Compare
@marcelsavegnago parabéns pelo trabalho!! Ficou OK para revisar? |
def _build_attr(self, node, fields, vals, path, attr): | ||
if attr[0] == "enderEmit" and self.env.context.get("edoc_type") == "in": | ||
# we don't want to try build a related partner_id for enderEmit | ||
# when importing an NFe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrigir NFe -> MDFe
This pull request introduces support for the Manifesto Eletrônico de Documentos Fiscais (MDFe) in the Brazilian fiscal module. The changes include adding new constants, updating data files, and creating new models and views to handle MDFe documents.
Major Changes:
MDFe Support:
MODELO_FISCAL_MDFE
constant tol10n_br_fiscal/constants/fiscal.py
.l10n_br_fiscal/data/l10n_br_fiscal.document.type.csv
.l10n_br_fiscal/data/operation_data.xml
.New Models and Fields:
document_supplement
import inl10n_br_fiscal/models/__init__.py
.key_random_code
,key_check_digit
, andtotal_weight
inl10n_br_fiscal/models/document_mixin_fields.py
.currency_id
,document_total_weight
, anddocument_total_amount
fields tol10n_br_fiscal/models/document_related.py
.MDFe Module:
l10n_br_mdfe
module with initial setup and dependencies inl10n_br_mdfe/__manifest__.py
.l10n_br_mdfe/constants/mdfe.py
.Views and UI Enhancements:
l10n_br_fiscal/views/document_related_view.xml
to include total fields for MDFe.total_weight
field to delivery page inl10n_br_fiscal/views/document_view.xml
.