diff --git a/l10n_br_fiscal/models/operation_dashboard.py b/l10n_br_fiscal/models/operation_dashboard.py index d25889c30391..72b93fe780b0 100644 --- a/l10n_br_fiscal/models/operation_dashboard.py +++ b/l10n_br_fiscal/models/operation_dashboard.py @@ -102,6 +102,14 @@ def _get_cancelled_documents(self): def action_create_new(self): ctx = self._context.copy() model = "l10n_br_fiscal.document" + if self.document_type_ids: + ctx.update( + { + "default_document_type_id": self.document_type_ids[ + 0 + ].document_type_id.id, + } + ) if self.fiscal_operation_type == "out": ctx.update( { @@ -154,6 +162,7 @@ def open_action(self): ctx.update( { "default_fiscal_operation_type": fiscal_operation_type, + "create": False, } ) diff --git a/l10n_br_fiscal/views/l10n_br_fiscal_action.xml b/l10n_br_fiscal/views/l10n_br_fiscal_action.xml index 94f398b5a926..006b2095f84c 100644 --- a/l10n_br_fiscal/views/l10n_br_fiscal_action.xml +++ b/l10n_br_fiscal/views/l10n_br_fiscal_action.xml @@ -597,6 +597,7 @@ kanban,tree,form + {'create': False}

Create a new Document @@ -616,7 +617,9 @@ [('fiscal_operation_type', '=', 'in')] - {'default_fiscal_operation_type': 'in'} + {'default_fiscal_operation_type': 'in', 'create': False}

Create a new Document @@ -636,7 +639,9 @@ [('fiscal_operation_type', '=', 'out')] - {'default_fiscal_operation_type': 'out'} + {'default_fiscal_operation_type': 'out', 'create': False}

Create a new Document