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