diff --git a/.oca/oca-port/blacklist/account_reconcile_oca.json b/.oca/oca-port/blacklist/account_reconcile_oca.json
new file mode 100644
index 0000000000..395bb789c9
--- /dev/null
+++ b/.oca/oca-port/blacklist/account_reconcile_oca.json
@@ -0,0 +1,9 @@
+{
+ "pull_requests": {
+ "orphaned_commits": "Not needed",
+ "OCA/account-reconcile#500": "Not needed",
+ "OCA/account-reconcile#662": "Not needed",
+ "OCA/account-reconcile#702": "Already in v17",
+ "OCA/account-reconcile#758": "Cherry picked features"
+ }
+}
diff --git a/account_reconcile_oca/models/account_bank_statement.py b/account_reconcile_oca/models/account_bank_statement.py
index 19b9bec166..8ad1c39428 100644
--- a/account_reconcile_oca/models/account_bank_statement.py
+++ b/account_reconcile_oca/models/account_bank_statement.py
@@ -1,6 +1,7 @@
# Copyright 2024 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
+from odoo.tools.safe_eval import safe_eval
class AccountBankStatement(models.Model):
@@ -13,3 +14,17 @@ def action_open_statement(self):
)
action["res_id"] = self.id
return action
+
+ def action_open_statement_lines(self):
+ """Open in reconciling view directly"""
+ self.ensure_one()
+ if not self:
+ return {}
+ action = self.env["ir.actions.act_window"]._for_xml_id(
+ "account_reconcile_oca.action_bank_statement_line_reconcile"
+ )
+ action["domain"] = [("statement_id", "=", self.id)]
+ action["context"] = safe_eval(
+ action["context"], locals_dict={"active_id": self._context.get("active_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 4fff3d7f9e..eb8eee7203 100644
--- a/account_reconcile_oca/models/account_bank_statement_line.py
+++ b/account_reconcile_oca/models/account_bank_statement_line.py
@@ -282,6 +282,46 @@ def _check_line_changed(self, line):
!= line.get("partner_id")
)
+ def _get_manual_delete_vals(self):
+ return {
+ "manual_reference": False,
+ "manual_account_id": False,
+ "manual_amount": False,
+ "manual_exchange_counterpart": False,
+ "manual_in_currency_id": False,
+ "manual_in_currency": False,
+ "manual_name": False,
+ "manual_partner_id": False,
+ "manual_line_id": False,
+ "manual_move_id": False,
+ "manual_move_type": False,
+ "manual_kind": False,
+ "manual_original_amount": False,
+ "manual_currency_id": False,
+ "analytic_distribution": False,
+ }
+
+ def _process_manual_reconcile_from_line(self, line):
+ self.manual_account_id = line["account_id"][0]
+ self.manual_amount = line["amount"]
+ self.manual_currency_id = line["currency_id"]
+ self.manual_in_currency_id = line.get("line_currency_id")
+ self.manual_in_currency = line.get("line_currency_id") and line[
+ "currency_id"
+ ] != line.get("line_currency_id")
+ self.manual_amount_in_currency = line.get("currency_amount")
+ self.manual_name = line["name"]
+ self.manual_exchange_counterpart = line.get("is_exchange_counterpart", False)
+ self.manual_partner_id = line.get("partner_id") and line["partner_id"][0]
+ manual_line = self.env["account.move.line"].browse(line["id"]).exists()
+ self.manual_line_id = manual_line
+ self.analytic_distribution = line.get("analytic_distribution", {})
+ if self.manual_line_id:
+ self.manual_move_id = self.manual_line_id.move_id
+ self.manual_move_type = self.manual_line_id.move_id.move_type
+ self.manual_kind = line["kind"]
+ self.manual_original_amount = line.get("original_amount", 0.0)
+
@api.onchange("manual_reference", "manual_delete")
def _onchange_manual_reconcile_reference(self):
self.ensure_one()
@@ -302,53 +342,10 @@ def _onchange_manual_reconcile_reference(self):
continue
if line["reference"] == self.manual_reference:
if self.manual_delete:
- self.update(
- {
- "manual_reference": False,
- "manual_account_id": False,
- "manual_amount": False,
- "manual_exchange_counterpart": False,
- "manual_in_currency_id": False,
- "manual_in_currency": False,
- "manual_name": False,
- "manual_partner_id": False,
- "manual_line_id": False,
- "manual_move_id": False,
- "manual_move_type": False,
- "manual_kind": False,
- "manual_original_amount": False,
- "manual_currency_id": False,
- "analytic_distribution": False,
- "manual_amount_in_currency": False,
- }
- )
+ self.update(self._get_manual_delete_vals())
continue
else:
- self.manual_account_id = line["account_id"][0]
- self.manual_amount = line["amount"]
- self.manual_currency_id = line["currency_id"]
- self.manual_in_currency_id = line.get("line_currency_id")
- self.manual_in_currency = line.get("line_currency_id") and line[
- "currency_id"
- ] != line.get("line_currency_id")
- self.manual_amount_in_currency = line.get("currency_amount")
- self.manual_name = line["name"]
- self.manual_exchange_counterpart = line.get(
- "is_exchange_counterpart", False
- )
- self.manual_partner_id = (
- line.get("partner_id") and line["partner_id"][0]
- )
- manual_line = (
- self.env["account.move.line"].browse(line["id"]).exists()
- )
- self.manual_line_id = manual_line
- self.analytic_distribution = line.get("analytic_distribution", {})
- if self.manual_line_id:
- self.manual_move_id = self.manual_line_id.move_id
- self.manual_move_type = self.manual_line_id.move_id.move_type
- self.manual_kind = line["kind"]
- self.manual_original_amount = line.get("original_amount", 0.0)
+ self._process_manual_reconcile_from_line(line)
new_data.append(line)
self.update({"manual_delete": False})
self.reconcile_data_info = self._recompute_suspense_line(
@@ -369,6 +366,26 @@ def _onchange_manual_amount_in_currency(self):
)
self._onchange_manual_reconcile_vals()
+ def _get_manual_reconcile_vals(self):
+ return {
+ "name": self.manual_name,
+ "partner_id": (
+ self.manual_partner_id
+ and [self.manual_partner_id.id, self.manual_partner_id.display_name]
+ or (self.partner_name and (False, self.partner_name))
+ or False
+ ),
+ "account_id": (
+ [self.manual_account_id.id, self.manual_account_id.display_name]
+ if self.manual_account_id
+ else [False, _("Undefined")]
+ ),
+ "amount": self.manual_amount,
+ "credit": -self.manual_amount if self.manual_amount < 0 else 0.0,
+ "debit": self.manual_amount if self.manual_amount > 0 else 0.0,
+ "analytic_distribution": self.analytic_distribution,
+ }
+
@api.onchange(
"manual_account_id",
"manual_partner_id",
@@ -383,35 +400,11 @@ def _onchange_manual_reconcile_vals(self):
for line in data:
if line["reference"] == self.manual_reference:
if self._check_line_changed(line):
- line.update(
- {
- "name": self.manual_name,
- "partner_id": self.manual_partner_id
- and [
- self.manual_partner_id.id,
- self.manual_partner_id.display_name,
- ]
- or (self.partner_name and (False, self.partner_name))
- or False,
- "account_id": [
- self.manual_account_id.id,
- self.manual_account_id.display_name,
- ]
- if self.manual_account_id
- else [False, _("Undefined")],
- "amount": self.manual_amount,
- "credit": -self.manual_amount
- if self.manual_amount < 0
- else 0.0,
- "debit": self.manual_amount
- if self.manual_amount > 0
- else 0.0,
- "analytic_distribution": self.analytic_distribution,
- "kind": line["kind"]
- if line["kind"] != "suspense"
- else "other",
- }
+ line_vals = self._get_manual_reconcile_vals()
+ line_vals["kind"] = (
+ line["kind"] if line["kind"] != "suspense" else "other"
)
+ line.update(line_vals)
if line["kind"] == "liquidity":
self._update_move_partner()
if self.manual_line_id and self.manual_line_id.id == line.get(
diff --git a/account_reconcile_oca/static/src/scss/reconcile.scss b/account_reconcile_oca/static/src/scss/reconcile.scss
index b430a1045c..c89632b5e0 100644
--- a/account_reconcile_oca/static/src/scss/reconcile.scss
+++ b/account_reconcile_oca/static/src/scss/reconcile.scss
@@ -11,6 +11,10 @@
opacity: 100;
}
}
+ .row {
+ // We need to add this in order to make remove horizontal scroll
+ margin: 0;
+ }
margin: 0 0 0;
min-width: fit-content;
width: 100%;
@@ -36,10 +40,12 @@
padding: 0;
position: relative;
border-right: 1px solid $o-gray-300;
+ overflow: auto;
}
.o_account_reconcile_oca_info {
width: 70%;
height: 100%;
+ overflow: auto;
}
.o_form_view {
.o_form_statusbar.o_account_reconcile_oca_statusbar {
diff --git a/account_reconcile_oca/views/account_bank_statement.xml b/account_reconcile_oca/views/account_bank_statement.xml
index ac615d7f53..4f4af4a391 100644
--- a/account_reconcile_oca/views/account_bank_statement.xml
+++ b/account_reconcile_oca/views/account_bank_statement.xml
@@ -31,7 +31,22 @@
-
+
+ account.bank.statement
+
+
+
+ object
+ action_open_statement_lines
+
+
+
Edit Bank Statement
account.bank.statement