Skip to content
Snippets Groups Projects
Commit be340d44 authored by szeka.wong's avatar szeka.wong
Browse files

Add a new state to monthly statements for manual validation.

parent 4d21f6ad
No related branches found
No related tags found
1 merge request!25Add a new state to monthly statements for manual validation.
Pipeline #68827 passed
......@@ -3,6 +3,7 @@
* On accounting entry reconciliation, the restriction to one partner associated
to reconciled entries can be deactivated, using a context key.
* Add a new state to monthly statements for manual validation.
11.0.1.4.0
==========
......
......@@ -114,7 +114,11 @@
)
state = fields.Selection(
selection=[("in_progress", "In Progress"), ("done", "Done")],
selection=[
("draft", "Draft"),
("in_progress", "In Progress"),
("done", "Done"),
],
string="State",
readonly=True,
required=True,
......@@ -130,6 +134,12 @@
)
@api.multi
def validate(self):
self.write({"state": "in_progress"})
for statement in self:
statement.register_process_job()
@api.multi
def open_lines(self):
"""View display action that opens lines through breadcrumbs."""
......
......@@ -217,6 +217,11 @@
self.assertEqual(batch.account_move_line_count, 1)
self.assertEqual(batch.account_move_line_ids, line_to_pay)
self.assertAlmostEqual(batch.amount, AMOUNT)
self.assertEqual(batch.state, "draft")
batch.validate()
self.assertEqual(batch.state, "in_progress")
# Run queued job to process the batch.
......
......@@ -51,6 +51,9 @@
<form create="0" edit="0" delete="0">
<header>
<button name="validate" type="object" string="Validate"
class="oe_highlight"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
<field name="state" widget="statusbar" />
</header>
......
......@@ -222,7 +222,7 @@
"end_date": self.end_date,
"monthly_statement_kind_id": monthly_statement_kind_id,
"partner_id": partner_id,
"state": "in_progress",
"state": "draft",
"with_end_client": self.with_end_client,
}
)
......@@ -226,7 +226,6 @@
"with_end_client": self.with_end_client,
}
)
batch.register_process_job()
batches |= batch
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment