Skip to content

Commit

Permalink
[WIP][IMP] l10n_br_mdfe: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Dec 5, 2024
1 parent 2e1d1f7 commit 0496f83
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions l10n_br_mdfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ class MDFe(spec_models.StackedModel):
"odoo.addons.l10n_br_mdfe_spec.models.v3_0.mdfe_tipos_basico_v3_00"
)
_mdfe30_stacking_mixin = "mdfe.30.tmdfe_infmdfe"

_mdfe30_stacking_skip_paths = ("mdfe30_valePed",)

# all m2o at this level will be stacked even if not required:
_mdfe30_stacking_force_paths = [
"infmdfe.infAdic",
Expand Down
3 changes: 2 additions & 1 deletion l10n_br_mdfe/models/modal_rodoviario.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class MDFeModalRodoviario(spec_models.StackedModel):
_mdfe30_binding_module = "nfelib.mdfe.bindings.v3_0.mdfe_modal_rodoviario_v3_00"
_mdfe30_stacking_mixin = "mdfe.30.rodo"
# all m2o at this level will be stacked even if not required:
_mdfe30_stacking_force_paths = ["rodo.infANTT", "rodo.infANTT.ValePed"]
_mdfe30_stacking_force_paths = ["rodo.infANTT", "rodo.infANTT.InfContratante"]
_mdfe30_stacking_skip_paths = ("mdfe30_valePed",)

document_id = fields.Many2one(comodel_name="l10n_br_fiscal.document")

Expand Down
17 changes: 15 additions & 2 deletions l10n_br_mdfe/views/document.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
>{'invisible': [('document_type', 'in', ['58'])]}</attribute>
</xpath>

<xpath expr="//field[@name='fiscal_operation_id']" position="after">
<xpath expr="//field[@name='issuer']" position="after">
<field
name="mdfe_emit_type"
attrs="{'invisible': [('document_type', 'not in', ['58'])]}"
Expand Down Expand Up @@ -116,6 +116,20 @@
attrs="{'invisible': [('document_type', 'not in', ['58'])]}"
/>
</xpath>

<xpath expr="//page[@name='others']" position="inside">
<separator
colspan="4"
string="Authorized to Download XML"
attrs="{'invisible': [('document_type', 'not in', ['58'])]}"
/>
<field
name="mdfe30_autXML"
widget="many2many"
attrs="{'invisible': [('document_type', 'not in', ['58'])]}"
/>
</xpath>

</field>
</record>

Expand Down Expand Up @@ -178,7 +192,6 @@
>
<group>
<field name="mdfe_modal" widget="radio" />
<field name="mdfe_transp_type" />
</group>

<group
Expand Down

0 comments on commit 0496f83

Please sign in to comment.