Skip to content

Commit

Permalink
[IMP] l10n_br_sped_base: done/reset to draft
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed May 27, 2024
1 parent 5d23cf9 commit 1da5fb0
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion l10n_br_sped_base/models/sped_declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ def button_flush_registers(self):
self.ensure_one()
self.env["l10n_br_sped.mixin"]._flush_registers(self._get_kind(), self.id)

def button_done(self):
self.state = "done"

def button_draft(self):
self.state = "draft"

def button_create_sped_file(self):
self.ensure_one()
sped_txt = self._generate_sped_text()
Expand Down Expand Up @@ -150,9 +156,29 @@ def _append_view_header(self, form):
)
header.append(
E.button(
name="button_create_sped_file",
name="button_done",
type="object",
states="draft",
string="Set to Done",
# class="oe_highlight",
groups="l10n_br_fiscal.group_manager",
)
)
header.append(
E.button(
name="button_draft",
type="object",
states="done",
string="Reset to Draft",
# class="oe_highlight",
groups="l10n_br_fiscal.group_manager",
)
)
header.append(
E.button(
name="button_create_sped_file",
type="object",
states="done",
string="Generate SPED File",
# class="oe_highlight",
groups="l10n_br_fiscal.group_manager",
Expand Down

0 comments on commit 1da5fb0

Please sign in to comment.