diff --git a/account_reconcile_oca/models/account_bank_statement.py b/account_reconcile_oca/models/account_bank_statement.py
index 52a64a2f..19b9bec1 100644
--- a/account_reconcile_oca/models/account_bank_statement.py
+++ b/account_reconcile_oca/models/account_bank_statement.py
@@ -11,6 +11,5 @@ class AccountBankStatement(models.Model):
action = self.env["ir.actions.act_window"]._for_xml_id(
"account_reconcile_oca.account_bank_statement_action_edit"
)
- print(action)
action["res_id"] = self.id
return action
diff --git a/account_reconcile_oca/models/account_bank_statement_line.py b/account_reconcile_oca/models/account_bank_statement_line.py
index b5fab233..36971169 100644
--- a/account_reconcile_oca/models/account_bank_statement_line.py
+++ b/account_reconcile_oca/models/account_bank_statement_line.py
@@ -769,3 +769,25 @@ class AccountBankStatementLine(models.Model):
if vals["partner_id"] is False and self.partner_name:
vals["partner_id"] = (False, self.partner_name)
return vals
+
+ def add_statement(self):
+ self.ensure_one()
+ action = self.env["ir.actions.act_window"]._for_xml_id(
+ "account_reconcile_oca.account_bank_statement_action_edit"
+ )
+ previous_line_with_statement = self.env["account.bank.statement.line"].search(
+ [
+ ("internal_index", "<", self.internal_index),
+ ("journal_id", "=", self.journal_id.id),
+ ("state", "=", "posted"),
+ ("statement_id", "!=", self.statement_id.id),
+ ("statement_id", "!=", False),
+ ],
+ limit=1,
+ )
+ action["context"] = {
+ "default_journal_id": self.journal_id.id,
+ "default_balance_start": previous_line_with_statement.statement_id.balance_end_real,
+ "split_line_id": self.id,
+ }
+ return action
diff --git a/account_reconcile_oca/static/src/scss/reconcile.scss b/account_reconcile_oca/static/src/scss/reconcile.scss
index f8fa60fe..9a574985 100644
--- a/account_reconcile_oca/static/src/scss/reconcile.scss
+++ b/account_reconcile_oca/static/src/scss/reconcile.scss
@@ -6,9 +6,23 @@
flex-flow: row wrap;
height: 100%;
.o_kanban_renderer.o_kanban_ungrouped .o_kanban_record {
+ &:hover {
+ .o_reconcile_create_statement {
+ opacity: 100;
+ }
+ }
margin: 0 0 0;
min-width: fit-content;
width: 100%;
+ .o_reconcile_create_statement {
+ position: absolute;
+ height: 4px;
+ margin: 0;
+ padding: 2px 0 0 0;
+ border: 0;
+ top: -14px;
+ opacity: 0;
+ }
> div {
border-right: thick solid rgba(0, 0, 0, 0);
}
diff --git a/account_reconcile_oca/views/account_bank_statement.xml b/account_reconcile_oca/views/account_bank_statement.xml
index d081b50b..ac615d7f 100644
--- a/account_reconcile_oca/views/account_bank_statement.xml
+++ b/account_reconcile_oca/views/account_bank_statement.xml
@@ -24,6 +24,7 @@
+
diff --git a/account_reconcile_oca/views/account_bank_statement_line.xml b/account_reconcile_oca/views/account_bank_statement_line.xml
index 95f8263c..fc8d16b8 100644
--- a/account_reconcile_oca/views/account_bank_statement_line.xml
+++ b/account_reconcile_oca/views/account_bank_statement_line.xml
@@ -17,6 +17,20 @@
+