[MIG] account_reconcile_oca from v17 to v18
parent
dc28337385
commit
fee65b9d9e
|
@ -5,7 +5,7 @@
|
|||
"name": "Account Reconcile Oca",
|
||||
"summary": """
|
||||
Reconcile addons for Odoo CE accounting""",
|
||||
"version": "17.0.1.5.6",
|
||||
"version": "18.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "CreuBlanca,Dixmit,Odoo Community Association (OCA)",
|
||||
"maintainers": ["etobella"],
|
||||
|
|
|
@ -24,13 +24,11 @@ class AccountAccountReconcile(models.Model):
|
|||
|
||||
@property
|
||||
def _table_query(self):
|
||||
return "{} {} {} {} {}".format(
|
||||
self._select(),
|
||||
self._from(),
|
||||
self._where(),
|
||||
self._groupby(),
|
||||
self._having(),
|
||||
query = (
|
||||
f"{self._select()} {self._from()} {self._where()} "
|
||||
f"{self._groupby()} {self._having()}"
|
||||
)
|
||||
return query
|
||||
|
||||
def _select(self):
|
||||
account_account_name_field = (
|
||||
|
@ -55,7 +53,7 @@ class AccountAccountReconcile(models.Model):
|
|||
a.id as account_id,
|
||||
FALSE as is_reconciled,
|
||||
aml.currency_id as currency_id,
|
||||
a.company_id,
|
||||
am.company_id,
|
||||
null as foreign_currency_id
|
||||
"""
|
||||
|
||||
|
@ -84,7 +82,7 @@ class AccountAccountReconcile(models.Model):
|
|||
ELSE NULL
|
||||
END,
|
||||
aml.currency_id,
|
||||
a.company_id
|
||||
am.company_id
|
||||
"""
|
||||
|
||||
def _having(self):
|
||||
|
|
|
@ -22,7 +22,6 @@ class AccountBankStatementLine(models.Model):
|
|||
._fields["reconcile_mode"]
|
||||
.selection
|
||||
)
|
||||
company_id = fields.Many2one(related="journal_id.company_id")
|
||||
reconcile_data = fields.Serialized()
|
||||
manual_line_id = fields.Many2one(
|
||||
"account.move.line",
|
||||
|
@ -290,7 +289,7 @@ class AccountBankStatementLine(models.Model):
|
|||
can_reconcile = True
|
||||
account = self.partner_id.property_account_payable_id
|
||||
suspense_line = {
|
||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||
"reference": f"reconcile_auxiliary;{reconcile_auxiliary_id}",
|
||||
"id": False,
|
||||
"account_id": [account.id, account.display_name],
|
||||
"partner_id": self.partner_id
|
||||
|
@ -587,7 +586,7 @@ class AccountBankStatementLine(models.Model):
|
|||
)
|
||||
new_line.update(
|
||||
{
|
||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||
"reference": f"reconcile_auxiliary;{reconcile_auxiliary_id}",
|
||||
"id": False,
|
||||
"amount": amount,
|
||||
"debit": amount if amount > 0 else 0,
|
||||
|
@ -765,7 +764,7 @@ class AccountBankStatementLine(models.Model):
|
|||
def reconcile_bank_line(self):
|
||||
self.ensure_one()
|
||||
self.reconcile_mode = self.journal_id.reconcile_mode
|
||||
result = getattr(self, "_reconcile_bank_line_%s" % self.reconcile_mode)(
|
||||
result = getattr(self, f"_reconcile_bank_line_{self.reconcile_mode}")(
|
||||
self._prepare_reconcile_line_data(self.reconcile_data_info["data"])
|
||||
)
|
||||
self.reconcile_data = False
|
||||
|
@ -773,7 +772,9 @@ class AccountBankStatementLine(models.Model):
|
|||
|
||||
def _reconcile_bank_line_edit(self, data):
|
||||
_liquidity_lines, suspense_lines, other_lines = self._seek_for_lines()
|
||||
lines_to_remove = [(2, line.id) for line in suspense_lines + other_lines]
|
||||
lines_to_remove = [
|
||||
Command.delete(line.id) for line in suspense_lines + other_lines
|
||||
]
|
||||
|
||||
# Cleanup previous lines.
|
||||
move = self.move_id
|
||||
|
@ -784,6 +785,7 @@ class AccountBankStatementLine(models.Model):
|
|||
skip_account_move_synchronization=True,
|
||||
force_delete=True,
|
||||
skip_invoice_sync=True,
|
||||
skip_readonly_check=True,
|
||||
).write(
|
||||
{
|
||||
"line_ids": lines_to_remove,
|
||||
|
@ -983,9 +985,9 @@ class AccountBankStatementLine(models.Model):
|
|||
)
|
||||
if not data.get("can_reconcile"):
|
||||
continue
|
||||
getattr(
|
||||
record, "_reconcile_bank_line_%s" % record.journal_id.reconcile_mode
|
||||
)(self._prepare_reconcile_line_data(data["data"]))
|
||||
getattr(record, f"_reconcile_bank_line_{record.journal_id.reconcile_mode}")(
|
||||
self._prepare_reconcile_line_data(data["data"])
|
||||
)
|
||||
return result
|
||||
|
||||
def _synchronize_to_moves(self, changed_fields):
|
||||
|
@ -1100,7 +1102,7 @@ class AccountBankStatementLine(models.Model):
|
|||
new_data += lines
|
||||
new_data.append(
|
||||
{
|
||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||
"reference": f"reconcile_auxiliary;{reconcile_auxiliary_id}",
|
||||
"id": False,
|
||||
"account_id": line["account_id"],
|
||||
"partner_id": line.get("partner_id"),
|
||||
|
@ -1127,13 +1129,13 @@ class AccountBankStatementLine(models.Model):
|
|||
|
||||
def action_to_check(self):
|
||||
self.ensure_one()
|
||||
self.move_id.to_check = True
|
||||
self.move_id.write({"checked": False})
|
||||
if self.can_reconcile and self.journal_id.reconcile_mode == "edit":
|
||||
self.reconcile_bank_line()
|
||||
|
||||
def action_checked(self):
|
||||
self.ensure_one()
|
||||
self.move_id.to_check = False
|
||||
self.move_id.write({"checked": True})
|
||||
|
||||
def _get_reconcile_line(
|
||||
self,
|
||||
|
@ -1219,7 +1221,7 @@ class AccountBankStatementLine(models.Model):
|
|||
data = {
|
||||
"is_exchange_counterpart": True,
|
||||
"original_exchange_line_id": line.id,
|
||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||
"reference": f"reconcile_auxiliary;{reconcile_auxiliary_id}",
|
||||
"id": False,
|
||||
"account_id": (account.id, account.display_name),
|
||||
"partner_id": False,
|
||||
|
|
|
@ -88,7 +88,7 @@ class AccountReconcileAbstract(models.AbstractModel):
|
|||
vals = {
|
||||
"move_id": move and line.move_id.id,
|
||||
"move": move and line.move_id.name,
|
||||
"reference": "account.move.line;%s" % line.id,
|
||||
"reference": f"account.move.line;{line.id}",
|
||||
"id": line.id,
|
||||
"account_id": [line.account_id.id, line.account_id.display_name],
|
||||
"partner_id": [line.partner_id.id, line.partner_id.display_name]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/** @odoo-module */
|
||||
const {onMounted, onWillStart, useState, useSubEnv} = owl;
|
||||
import {useBus, useService} from "@web/core/utils/hooks";
|
||||
import {KanbanController} from "@web/views/kanban/kanban_controller";
|
||||
import {View} from "@web/views/view";
|
||||
import {formatMonetary} from "@web/views/fields/formatters";
|
||||
import {router} from "@web/core/browser/router";
|
||||
|
||||
export class ReconcileController extends KanbanController {
|
||||
async setup() {
|
||||
|
@ -20,7 +20,6 @@ export class ReconcileController extends KanbanController {
|
|||
this.effect = useService("effect");
|
||||
this.orm = useService("orm");
|
||||
this.action = useService("action");
|
||||
this.router = useService("router");
|
||||
this.activeActions = this.props.archInfo.activeActions;
|
||||
useBus(this.model.bus, "update", () => {
|
||||
this.selectRecord();
|
||||
|
@ -134,7 +133,7 @@ export class ReconcileController extends KanbanController {
|
|||
this.selectRecord(record);
|
||||
}
|
||||
updateURL(resId) {
|
||||
this.router.pushState({id: resId});
|
||||
router.pushState({id: resId});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {KanbanRecord} from "@web/views/kanban/kanban_record";
|
||||
|
||||
export class ReconcileKanbanRecord extends KanbanRecord {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
|
||||
import {ReconcileKanbanRecord} from "./reconcile_kanban_record.esm.js";
|
||||
import {formatMonetary} from "@web/views/fields/formatters";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ReconcileController} from "./reconcile_controller.esm.js";
|
||||
import {ReconcileRenderer} from "./reconcile_renderer.esm.js";
|
||||
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {FormController} from "@web/views/form/form_controller";
|
||||
import {useService} from "@web/core/utils/hooks";
|
||||
import {useViewButtons} from "@web/views/view_button/view_button_hook";
|
||||
|
@ -11,7 +9,7 @@ export class ReconcileFormController extends FormController {
|
|||
this.env.exposeController(this);
|
||||
this.orm = useService("orm");
|
||||
const rootRef = useRef("root");
|
||||
useViewButtons(this.model, rootRef, {
|
||||
useViewButtons(rootRef, {
|
||||
reload: this.reloadFormController.bind(this),
|
||||
beforeExecuteAction: this.beforeExecuteActionButton.bind(this),
|
||||
afterExecuteAction: this.afterExecuteActionButton.bind(this),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/** @odoo-module */
|
||||
import {Notebook} from "@web/core/notebook/notebook";
|
||||
import {onWillDestroy} from "@odoo/owl";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {FormRenderer} from "@web/views/form/form_renderer";
|
||||
import {ReconcileFormNotebook} from "./reconcile_form_notebook.esm.js";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ReconcileFormController} from "./reconcile_form_controller.esm.js";
|
||||
import {ReconcileFormRenderer} from "./reconcile_form_renderer.esm.js";
|
||||
import {formView} from "@web/views/form/form_view";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {FormController} from "@web/views/form/form_controller";
|
||||
import {useViewButtons} from "@web/views/view_button/view_button_hook";
|
||||
const {useRef} = owl;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ReconcileManualController} from "./reconcile_manual_controller.esm.js";
|
||||
import {formView} from "@web/views/form/form_view";
|
||||
import {registry} from "@web/core/registry";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ListController} from "@web/views/list/list_controller";
|
||||
|
||||
export class ReconcileMoveLineController extends ListController {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ListRenderer} from "@web/views/list/list_renderer";
|
||||
|
||||
export class ReconcileMoveLineRenderer extends ListRenderer {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import {ReconcileMoveLineController} from "./reconcile_move_line_controller.esm.js";
|
||||
import {ReconcileMoveLineRenderer} from "./reconcile_move_line_renderer.esm.js";
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
// import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
|
||||
// Import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
|
||||
// import {Chatter} from "@mail/core/web/chatter";
|
||||
import {Chatter} from "@mail/core/web/chatter";
|
||||
import {Chatter} from "@mail/chatter/web_portal/chatter";
|
||||
|
||||
import {registry} from "@web/core/registry";
|
||||
import {standardFieldProps} from "@web/views/fields/standard_field_props";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/** @odoo-module **/
|
||||
import {formatDate, parseDate} from "@web/core/l10n/dates";
|
||||
import {formatMonetary} from "@web/views/fields/formatters";
|
||||
import {registry} from "@web/core/registry";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import {View} from "@web/views/view";
|
||||
import {evaluateBooleanExpr} from "@web/core/py_js/py";
|
||||
import {getFieldContext} from "@web/model/relational_model/utils";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/** @odoo-module **/
|
||||
import {
|
||||
BadgeSelectionField,
|
||||
badgeSelectionField,
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<button
|
||||
t-on-click="onClickNewButton"
|
||||
class="btn btn-primary"
|
||||
t-if="activeActions.create"
|
||||
t-if="props.archInfo.activeActions.create"
|
||||
>Create</button>
|
||||
</t>
|
||||
<t t-name="account_reconcile_oca.ReconcileMatchWidget">
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
from odoo import Command
|
||||
from odoo.tests import Form, tagged
|
||||
|
||||
from odoo.addons.account_reconcile_model_oca.tests.common import (
|
||||
|
@ -12,9 +13,9 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
return {**cls.env.context, "_test_account_reconcile_oca": True}
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls, chart_template_ref=None):
|
||||
super().setUpClass(chart_template_ref=chart_template_ref)
|
||||
cls.env = cls.env(context=cls._setup_context())
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
||||
cls.acc_bank_stmt_model = cls.env["account.bank.statement"]
|
||||
cls.acc_bank_stmt_line_model = cls.env["account.bank.statement.line"]
|
||||
cls.bank_journal_usd.suspense_account_id = (
|
||||
|
@ -28,7 +29,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
.search(
|
||||
[
|
||||
("account_type", "=", "asset_current"),
|
||||
("company_id", "=", cls.env.company.id),
|
||||
("company_ids", "in", cls.env.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
|
@ -40,7 +41,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
.search(
|
||||
[
|
||||
("account_type", "=", "asset_receivable"),
|
||||
("company_id", "=", cls.env.company.id),
|
||||
("company_ids", "in", cls.env.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
|
@ -52,7 +53,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
.search(
|
||||
[
|
||||
("account_type", "=", "equity"),
|
||||
("company_id", "=", cls.env.company.id),
|
||||
("company_ids", "in", cls.env.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
|
@ -63,7 +64,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
.search(
|
||||
[
|
||||
("account_type", "=", "asset_non_current"),
|
||||
("company_id", "=", cls.env.company.id),
|
||||
("company_ids", "in", cls.env.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
|
@ -73,23 +74,19 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
cls.move_1 = cls.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"credit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.non_current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"debit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
@ -98,23 +95,19 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
cls.move_2 = cls.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.non_current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"credit": 50,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.equity_account.id,
|
||||
"name": "DEMO",
|
||||
"debit": 50,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
@ -123,23 +116,19 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
cls.move_3 = cls.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.non_current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"credit": 50,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": cls.equity_account.id,
|
||||
"name": "DEMO",
|
||||
"debit": 50,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
@ -216,24 +205,20 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
move_1 = self.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"credit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.asset_receivable_account.id,
|
||||
"partner_id": self.env.user.partner_id.id,
|
||||
"name": "DEMO",
|
||||
"debit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
@ -243,24 +228,20 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
move_2 = self.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"debit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.asset_receivable_account.id,
|
||||
"partner_id": self.env.company.partner_id.id,
|
||||
"name": "DEMO",
|
||||
"credit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
@ -277,24 +258,20 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
move_3 = self.env["account.move"].create(
|
||||
{
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.current_assets_account.id,
|
||||
"name": "DEMO",
|
||||
"debit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
(
|
||||
0,
|
||||
0,
|
||||
Command.create(
|
||||
{
|
||||
"account_id": self.asset_receivable_account.id,
|
||||
"partner_id": self.env.user.partner_id.id,
|
||||
"name": "DEMO",
|
||||
"credit": 100,
|
||||
},
|
||||
}
|
||||
),
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import time
|
||||
|
||||
from odoo import Command
|
||||
from odoo.tests import Form, tagged
|
||||
|
||||
from odoo.addons.account_reconcile_model_oca.tests.common import (
|
||||
|
@ -14,8 +15,8 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
return {**cls.env.context, "_test_account_reconcile_oca": True}
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls, chart_template_ref=None):
|
||||
super().setUpClass(chart_template_ref=chart_template_ref)
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(context=cls._setup_context())
|
||||
# Auto-disable reconciliation model created automatically with
|
||||
# generate_account_reconcile_model() to avoid side effects in tests
|
||||
|
@ -39,7 +40,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
cls.current_assets_account = cls.env["account.account"].search(
|
||||
[
|
||||
("account_type", "=", "asset_current"),
|
||||
("company_id", "=", cls.env.company.id),
|
||||
("company_ids", "in", cls.env.company.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
|
@ -51,7 +52,9 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
"rule_type": "writeoff_button",
|
||||
"match_partner": True,
|
||||
"match_partner_ids": [],
|
||||
"line_ids": [(0, 0, {"account_id": cls.current_assets_account.id})],
|
||||
"line_ids": [
|
||||
Command.create({"account_id": cls.current_assets_account.id})
|
||||
],
|
||||
}
|
||||
)
|
||||
cls.tax_10 = cls.env["account.tax"].create(
|
||||
|
@ -190,7 +193,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
f.add_account_move_line_id = receivable1
|
||||
self.assertFalse(f.add_account_move_line_id)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
f.manual_reference = "account.move.line;%s" % receivable1.id
|
||||
f.manual_reference = f"account.move.line;{receivable1.id}"
|
||||
self.assertEqual(-50, f.manual_amount)
|
||||
self.assertEqual(2, len(bank_stmt_line.reconcile_data_info["data"]))
|
||||
bank_stmt_line.button_manual_reference_full_paid()
|
||||
|
@ -199,7 +202,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
bank_stmt_line,
|
||||
view="account_reconcile_oca.bank_statement_line_form_reconcile_view",
|
||||
) as f:
|
||||
f.manual_reference = "account.move.line;%s" % receivable1.id
|
||||
f.manual_reference = f"account.move.line;{receivable1.id}"
|
||||
self.assertEqual(-100, f.manual_amount)
|
||||
|
||||
def test_reconcile_invoice_unreconcile(self):
|
||||
|
@ -303,12 +306,12 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
f.add_account_move_line_id = receivable1
|
||||
self.assertFalse(f.add_account_move_line_id)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
f.manual_reference = "account.move.line;%s" % receivable1.id
|
||||
f.manual_reference = f"account.move.line;{receivable1.id}"
|
||||
self.assertEqual(f.manual_amount, -100)
|
||||
f.manual_amount = -70
|
||||
self.assertFalse(f.can_reconcile)
|
||||
f.add_account_move_line_id = receivable2
|
||||
f.manual_reference = "account.move.line;%s" % receivable2.id
|
||||
f.manual_reference = f"account.move.line;{receivable2.id}"
|
||||
self.assertEqual(f.manual_amount, -30)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
self.assertEqual(inv1.amount_residual_signed, 100)
|
||||
|
@ -366,12 +369,12 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
f.add_account_move_line_id = receivable1
|
||||
self.assertFalse(f.add_account_move_line_id)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
f.manual_reference = "account.move.line;%s" % receivable1.id
|
||||
f.manual_reference = f"account.move.line;{receivable1.id}"
|
||||
self.assertEqual(f.manual_amount, 100)
|
||||
f.manual_amount = 70
|
||||
self.assertFalse(f.can_reconcile)
|
||||
f.add_account_move_line_id = receivable2
|
||||
f.manual_reference = "account.move.line;%s" % receivable2.id
|
||||
f.manual_reference = f"account.move.line;{receivable2.id}"
|
||||
self.assertEqual(f.manual_amount, 30)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
self.assertEqual(inv1.amount_residual_signed, -100)
|
||||
|
@ -430,7 +433,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
bank statement.
|
||||
"""
|
||||
self.rule.line_ids.write(
|
||||
{"tax_ids": [(4, self.tax_10.id)], "force_tax_included": True}
|
||||
{"tax_ids": [Command.link(self.tax_10.id)], "force_tax_included": True}
|
||||
)
|
||||
bank_stmt = self.acc_bank_stmt_model.create(
|
||||
{
|
||||
|
@ -541,7 +544,9 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
"match_label": "contains",
|
||||
"match_label_param": "DEMO WRITEOFF",
|
||||
"auto_reconcile": True,
|
||||
"line_ids": [(0, 0, {"account_id": self.current_assets_account.id})],
|
||||
"line_ids": [
|
||||
Command.create({"account_id": self.current_assets_account.id})
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -617,7 +622,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
.move_id
|
||||
)
|
||||
bank_stmt_line.unreconcile_bank_line()
|
||||
self.assertTrue(reconcile_move.reversal_move_id)
|
||||
self.assertTrue(reconcile_move.reversal_move_ids)
|
||||
self.assertFalse(bank_stmt_line.is_reconciled)
|
||||
|
||||
def test_reconcile_model_with_foreign_currency(self):
|
||||
|
@ -709,13 +714,13 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
f.add_account_move_line_id = receivable1
|
||||
self.assertTrue(f.can_reconcile)
|
||||
self.assertFalse(bank_stmt_line.is_reconciled)
|
||||
self.assertFalse(bank_stmt_line.to_check)
|
||||
self.assertTrue(bank_stmt_line.checked)
|
||||
bank_stmt_line.action_to_check()
|
||||
self.assertTrue(bank_stmt_line.is_reconciled)
|
||||
self.assertTrue(bank_stmt_line.to_check)
|
||||
self.assertFalse(bank_stmt_line.checked)
|
||||
bank_stmt_line.action_checked()
|
||||
self.assertTrue(bank_stmt_line.is_reconciled)
|
||||
self.assertFalse(bank_stmt_line.to_check)
|
||||
self.assertTrue(bank_stmt_line.checked)
|
||||
|
||||
def test_reconcile_invoice_to_check_not_reconciled(self):
|
||||
"""
|
||||
|
@ -740,13 +745,13 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
}
|
||||
)
|
||||
self.assertFalse(bank_stmt_line.is_reconciled)
|
||||
self.assertFalse(bank_stmt_line.to_check)
|
||||
self.assertTrue(bank_stmt_line.checked)
|
||||
bank_stmt_line.action_to_check()
|
||||
self.assertFalse(bank_stmt_line.is_reconciled)
|
||||
self.assertTrue(bank_stmt_line.to_check)
|
||||
self.assertFalse(bank_stmt_line.checked)
|
||||
bank_stmt_line.action_checked()
|
||||
self.assertFalse(bank_stmt_line.is_reconciled)
|
||||
self.assertFalse(bank_stmt_line.to_check)
|
||||
self.assertTrue(bank_stmt_line.checked)
|
||||
|
||||
# Testing widget
|
||||
|
||||
|
@ -821,7 +826,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
f.add_account_move_line_id = receivable1
|
||||
self.assertFalse(f.add_account_move_line_id)
|
||||
self.assertTrue(f.can_reconcile)
|
||||
f.manual_reference = "account.move.line;%s" % receivable1.id
|
||||
f.manual_reference = f"account.move.line;{receivable1.id}"
|
||||
self.assertEqual(f.manual_amount, -100)
|
||||
f.manual_delete = True
|
||||
self.assertFalse(f.can_reconcile)
|
||||
|
@ -897,7 +902,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
) as f:
|
||||
self.assertFalse(f.can_reconcile)
|
||||
self.assertFalse(f.partner_id)
|
||||
f.manual_reference = "account.move.line;%s" % liquidity_lines.id
|
||||
f.manual_reference = f"account.move.line;{liquidity_lines.id}"
|
||||
f.manual_partner_id = inv1.partner_id
|
||||
f.save()
|
||||
self.assertEqual(f.partner_id, inv1.partner_id)
|
||||
|
@ -1051,12 +1056,12 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
def test_partner_name_with_parent(self):
|
||||
parent_partner = self.env["res.partner"].create(
|
||||
{
|
||||
"name": "test",
|
||||
"name": "test_account_reconcile_oca",
|
||||
}
|
||||
)
|
||||
child_partner = self.env["res.partner"].create(
|
||||
{
|
||||
"name": "test",
|
||||
"name": "test_account_reconcile_oca",
|
||||
"parent_id": parent_partner.id,
|
||||
"type": "delivery",
|
||||
}
|
||||
|
@ -1072,7 +1077,6 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
"name": "test",
|
||||
}
|
||||
)
|
||||
|
||||
self.invoice_matching_models.active = True
|
||||
self.invoice_matching_models.match_text_location_label = False
|
||||
bank_stmt_line = self.acc_bank_stmt_line_model.create(
|
||||
|
@ -1083,10 +1087,9 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|||
"amount": 100,
|
||||
"date": time.strftime("%Y-07-15"),
|
||||
"payment_ref": "test",
|
||||
"partner_name": "test",
|
||||
"partner_name": "test_account_reconcile_oca",
|
||||
}
|
||||
)
|
||||
|
||||
bkstmt_data = bank_stmt_line.reconcile_data_info
|
||||
self.assertEqual(len(bkstmt_data["counterparts"]), 1)
|
||||
self.assertEqual(
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<odoo>
|
||||
|
||||
<record model="ir.ui.view" id="view_account_list">
|
||||
<field name="name">account.account.tree (in account_reconcile_oca)</field>
|
||||
<field name="name">account.account.list (in account_reconcile_oca)</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_list" />
|
||||
<field name="arch" type="xml">
|
||||
<tree position="inside">
|
||||
<list position="inside">
|
||||
<button
|
||||
type="action"
|
||||
name="%(account_reconcile_oca.account_account_account_account_reconcile_act_window)s"
|
||||
|
@ -16,7 +16,7 @@
|
|||
class="float-end btn-secondary"
|
||||
invisible="reconcile == False"
|
||||
/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
name="add_account_move_line_id"
|
||||
widget="account_reconcile_oca_match"
|
||||
domain="[('parent_state', '=', 'posted'), ('amount_residual', '!=', 0), ('account_id', '=', account_id)]"
|
||||
context="{'search_default_partner_id': partner_id, 'tree_view_ref': 'account_reconcile_oca.account_move_line_tree_reconcile_view', 'search_view_ref': 'account_reconcile_oca.account_move_line_search_reconcile_view'}"
|
||||
context="{'search_default_partner_id': partner_id, 'list_view_ref': 'account_reconcile_oca.account_move_line_tree_reconcile_view', 'search_view_ref': 'account_reconcile_oca.account_move_line_search_reconcile_view'}"
|
||||
/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
@ -82,15 +82,15 @@
|
|||
<record model="ir.ui.view" id="account_account_reconcile_tree_view">
|
||||
<field
|
||||
name="name"
|
||||
>account.account.reconcile.tree (in account_reconcile_oca)</field>
|
||||
>account.account.reconcile.list (in account_reconcile_oca)</field>
|
||||
<field name="model">account.account.reconcile</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<list>
|
||||
<!-- TODO -->
|
||||
<field name="id" />
|
||||
<field name="account_id" />
|
||||
<field name="partner_id" />
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -102,18 +102,13 @@
|
|||
<field name="arch" type="xml">
|
||||
<kanban js_class="reconcile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div
|
||||
t-attf-class="oe_kanban_card oe_kanban_global_click"
|
||||
style="width:100%"
|
||||
>
|
||||
<t t-name="card">
|
||||
<div>
|
||||
<field name="account_id" />
|
||||
</div>
|
||||
<div>
|
||||
<field name="partner_id" />
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
|
@ -161,9 +156,9 @@
|
|||
|
||||
<record model="ir.ui.menu" id="account_account_reconcile_menu">
|
||||
<field name="name">Reconcile</field>
|
||||
<field name="parent_id" ref="account.menu_finance_entries_actions" />
|
||||
<field name="parent_id" ref="account.menu_finance_entries" />
|
||||
<field name="action" ref="account_account_reconcile_act_window" />
|
||||
<field name="sequence" eval="10" />
|
||||
<field name="sequence" eval="140" />
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
<field name="foreign_currency_id" />
|
||||
<field name="statement_id" />
|
||||
<field name="statement_balance_end_real" />
|
||||
<field name="to_check" />
|
||||
<field name="checked" />
|
||||
<field name="reconcile_aggregate" />
|
||||
<field name="aggregate_id" />
|
||||
<field name="aggregate_name" />
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<t t-name="card">
|
||||
<div
|
||||
t-if="record.reconcile_aggregate.raw_value == 'statement' and !record.statement_id.raw_value"
|
||||
class="o_reconcile_create_statement text-center"
|
||||
|
@ -33,10 +33,6 @@
|
|||
Statement
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="oe_kanban_card oe_kanban_global_click"
|
||||
style="width:100%"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<field name="date" />
|
||||
|
@ -53,10 +49,9 @@
|
|||
options="{'currency_field': 'foreign_currency_id'}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<field name="partner_id" />
|
||||
<field name="partner_id" widget="badge" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
|
@ -64,7 +59,7 @@
|
|||
</div>
|
||||
<div class="col-4" style="text-align:right">
|
||||
<div
|
||||
t-if="record.to_check.raw_value"
|
||||
t-if="!record.checked.raw_value"
|
||||
class="badge text-bg-warning"
|
||||
>
|
||||
To check
|
||||
|
@ -77,7 +72,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
|
@ -163,14 +157,14 @@
|
|||
string="Validate"
|
||||
accesskey="v"
|
||||
class="btn btn-primary mx-1"
|
||||
invisible="is_reconciled == True or can_reconcile == False"
|
||||
invisible="is_reconciled or not can_reconcile"
|
||||
/>
|
||||
<button
|
||||
name="reconcile_bank_line"
|
||||
type="object"
|
||||
string="Reconcile"
|
||||
class="btn btn-primary disabled mx-1"
|
||||
invisible="is_reconciled == True or can_reconcile == True"
|
||||
invisible="is_reconciled or can_reconcile"
|
||||
/>
|
||||
<button
|
||||
name="unreconcile_bank_line"
|
||||
|
@ -178,7 +172,7 @@
|
|||
string="Unreconcile"
|
||||
accesskey="r"
|
||||
class="btn btn-warning mx-1"
|
||||
invisible="is_reconciled == False"
|
||||
invisible="not is_reconciled"
|
||||
confirm="Are you sure that the move should be unreconciled?"
|
||||
/>
|
||||
<button
|
||||
|
@ -186,7 +180,7 @@
|
|||
type="object"
|
||||
string="Reset reconciliation"
|
||||
class="btn btn-secondary mx-1"
|
||||
invisible="is_reconciled == True"
|
||||
invisible="is_reconciled"
|
||||
/>
|
||||
<button
|
||||
name="action_to_check"
|
||||
|
@ -194,7 +188,7 @@
|
|||
class="btn btn-secondary mx-1"
|
||||
accesskey="c"
|
||||
type="object"
|
||||
invisible="to_check == True"
|
||||
invisible="not checked"
|
||||
/>
|
||||
<button
|
||||
name="action_checked"
|
||||
|
@ -202,7 +196,7 @@
|
|||
class="btn btn-secondary mx-1"
|
||||
accesskey="c"
|
||||
type="object"
|
||||
invisible="to_check == False"
|
||||
invisible="checked"
|
||||
/>
|
||||
<button
|
||||
name="action_show_move"
|
||||
|
@ -216,7 +210,7 @@
|
|||
<field name="id" invisible="1" />
|
||||
<field name="name" invisible="1" />
|
||||
<field name="can_reconcile" invisible="1" />
|
||||
<field name="to_check" invisible="1" />
|
||||
<field name="checked" invisible="1" />
|
||||
<field name="partner_id" invisible="1" />
|
||||
<field name="company_id" invisible="1" />
|
||||
<field name="journal_id" invisible="1" />
|
||||
|
@ -251,7 +245,7 @@
|
|||
name="add_account_move_line_id"
|
||||
widget="account_reconcile_oca_match"
|
||||
domain="[('parent_state', '=', 'posted'),('amount_residual', '!=', 0),('account_id.reconcile', '=', True), ('company_id', '=', company_id), ('statement_line_id', '!=', id)]"
|
||||
context="{'search_default_partner_id': partner_id, 'tree_view_ref': 'account_reconcile_oca.account_move_line_tree_reconcile_view', 'search_view_ref': 'account_reconcile_oca.account_move_line_search_reconcile_view'}"
|
||||
context="{'search_default_partner_id': partner_id, 'list_view_ref': 'account_reconcile_oca.account_move_line_tree_reconcile_view', 'search_view_ref': 'account_reconcile_oca.account_move_line_search_reconcile_view'}"
|
||||
/>
|
||||
</page>
|
||||
<page name="manual" string="Manual operation">
|
||||
|
@ -333,9 +327,11 @@
|
|||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page name="narration" string="Narration">
|
||||
<page name="narration" string="Other Info">
|
||||
<group id="other-main">
|
||||
<field name="payment_ref" />
|
||||
<field name="narration" />
|
||||
<field name="narration" colspan="2" nolabel="1" />
|
||||
</group>
|
||||
</page>
|
||||
<page name="chatter" string="Chatter">
|
||||
<field name="move_id" widget="account_reconcile_oca_chatter" />
|
||||
|
@ -351,12 +347,12 @@
|
|||
<field name="context">
|
||||
{'default_journal_id': active_id, 'search_default_not_reconciled': True, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}
|
||||
</field>
|
||||
<field name="view_mode">kanban,tree</field>
|
||||
<field name="view_mode">kanban,list</field>
|
||||
<field
|
||||
name="view_ids"
|
||||
eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('bank_statement_line_reconcile_view')}),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')})]"
|
||||
(0, 0, {'view_mode': 'list', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')})]"
|
||||
/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
|
@ -371,12 +367,12 @@
|
|||
<field
|
||||
name="context"
|
||||
>{'default_journal_id': active_id, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}</field>
|
||||
<field name="view_mode">kanban,tree</field>
|
||||
<field name="view_mode">kanban,list</field>
|
||||
<field
|
||||
name="view_ids"
|
||||
eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('bank_statement_line_reconcile_view')}),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')})]"
|
||||
(0, 0, {'view_mode': 'list', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')})]"
|
||||
/>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
|
|
|
@ -30,18 +30,15 @@
|
|||
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//kanban/templates//div[@id='dashboard_bank_cash_left']/t[1]"
|
||||
position="before"
|
||||
expr="//kanban/templates//div[@id='dashboard_bank_cash_left']/div[@name='bank_cash_buttons']"
|
||||
position="inside"
|
||||
>
|
||||
<t t-if="dashboard.number_to_reconcile > 0">
|
||||
<button
|
||||
type="action"
|
||||
t-if="dashboard.number_to_reconcile > 0"
|
||||
name="%(account_reconcile_oca.action_bank_statement_line_reconcile)s"
|
||||
class="btn btn-primary"
|
||||
> Reconcile <t
|
||||
t-esc="dashboard.number_to_reconcile"
|
||||
/> Items</button>
|
||||
</t>
|
||||
> Reconcile <t t-esc="dashboard.number_to_reconcile" /> Items</button>
|
||||
</xpath>
|
||||
<xpath
|
||||
expr="//kanban/templates//div[@id='dashboard_bank_cash_right']"
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<odoo>
|
||||
|
||||
<record id="account_move_line_tree_reconcile_view" model="ir.ui.view">
|
||||
<field name="name">account.move.line.tree.reconcile</field>
|
||||
<field name="name">account.move.line.list.reconcile</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="priority">99</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree
|
||||
<list
|
||||
js_class="reconcile_move_line"
|
||||
create="0"
|
||||
edit="0"
|
||||
|
@ -32,7 +32,7 @@
|
|||
string="View"
|
||||
class="btn btn-secondary"
|
||||
/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
Loading…
Reference in New Issue