mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-19 13:22:04 +02:00
account_reconcile_oca
This commit is contained in:
parent
64fdc5b0df
commit
a8804cdf59
95 changed files with 17541 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
from . import account_journal_dashboard
|
||||
from . import account_bank_statement_line
|
||||
from . import account_bank_statement
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
from odoo import _, models
|
||||
|
||||
|
||||
class AccountBankStatement(models.Model):
|
||||
_inherit = "account.bank.statement"
|
||||
|
||||
def action_open_statement_lines(self):
|
||||
self.ensure_one()
|
||||
if not self:
|
||||
return {}
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account_statement_base.account_bank_statement_line_action"
|
||||
)
|
||||
action.update(
|
||||
{
|
||||
"domain": [("statement_id", "=", self.id)],
|
||||
"context": {
|
||||
"default_statement_id": self.id,
|
||||
"default_journal_id": self._context.get("active_id")
|
||||
if self._context.get("active_model") == "account.journal"
|
||||
else None,
|
||||
"account_bank_statement_line_main_view": True,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return action
|
||||
|
||||
def open_entries(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"name": _("Journal Items"),
|
||||
"view_mode": "tree,form",
|
||||
"res_model": "account.move.line",
|
||||
"view_id": False,
|
||||
"type": "ir.actions.act_window",
|
||||
"context": {"search_default_group_by_move": 1, "expand": 1},
|
||||
"search_view_id": self.env.ref("account.view_account_move_line_filter").id,
|
||||
"domain": [
|
||||
"&",
|
||||
("parent_state", "=", "posted"),
|
||||
("statement_id", "=", self.id),
|
||||
],
|
||||
}
|
||||
|
||||
def _compute_balance_end(self):
|
||||
# Consider new lines amount in the balance
|
||||
# Remove if merged: https://github.com/odoo/odoo/pull/188675
|
||||
res = super()._compute_balance_end()
|
||||
for stmt in self:
|
||||
lines = stmt.line_ids.filtered(lambda x: not x._origin)
|
||||
stmt.balance_end += sum(lines.mapped("amount"))
|
||||
return res
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Copyright 2024 ForgeFlow
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountBankStatementLine(models.Model):
|
||||
_inherit = "account.bank.statement.line"
|
||||
|
||||
def action_open_journal_entry(self):
|
||||
self.ensure_one()
|
||||
if not self:
|
||||
return {}
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_line_form"
|
||||
)
|
||||
res = self.env.ref("account.view_move_form", False)
|
||||
result["views"] = [(res and res.id or False, "form")]
|
||||
result["res_id"] = self.move_id.id
|
||||
return result
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
from odoo import models
|
||||
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = "account.journal"
|
||||
|
||||
def create_cash_statement(self):
|
||||
# Totally override this action for avoiding the standard
|
||||
# message saying that you need to install the enterprise
|
||||
# module. We do the equivalent thing instead.
|
||||
self.ensure_one()
|
||||
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||
"account_statement_base.account_bank_statement_line_action"
|
||||
)
|
||||
action["context"] = {"search_default_journal_id": self.id}
|
||||
return action
|
||||
Loading…
Add table
Add a link
Reference in a new issue