[MIG] account_reconcile_oca: Migration to 17.0
parent
f60c15ffb0
commit
103a4c506b
|
@ -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": "16.0.1.2.7",
|
"version": "17.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"],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
def post_init_hook(cr, registry):
|
def post_init_hook(env):
|
||||||
cr.execute(
|
env.cr.execute(
|
||||||
"""
|
"""
|
||||||
UPDATE account_bank_statement_line
|
UPDATE account_bank_statement_line
|
||||||
SET reconcile_mode = 'edit'
|
SET reconcile_mode = 'edit'
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
from openupgradelib import openupgrade
|
|
||||||
|
|
||||||
|
|
||||||
@openupgrade.migrate()
|
|
||||||
def migrate(env, version):
|
|
||||||
# Due to the big change we did, we need to loose how data is stored
|
|
||||||
openupgrade.logged_query(
|
|
||||||
env.cr,
|
|
||||||
"""
|
|
||||||
UPDATE account_bank_statement_line
|
|
||||||
SET reconcile_data = NULL
|
|
||||||
""",
|
|
||||||
)
|
|
||||||
openupgrade.logged_query(
|
|
||||||
env.cr,
|
|
||||||
"""
|
|
||||||
DELETE FROM account_account_reconcile_data
|
|
||||||
""",
|
|
||||||
)
|
|
|
@ -24,7 +24,7 @@ class AccountAccountReconcile(models.Model):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _table_query(self):
|
def _table_query(self):
|
||||||
return "%s %s %s %s %s" % (
|
return "{} {} {} {} {}".format(
|
||||||
self._select(),
|
self._select(),
|
||||||
self._from(),
|
self._from(),
|
||||||
self._where(),
|
self._where(),
|
||||||
|
|
|
@ -186,9 +186,9 @@ class AccountBankStatementLine(models.Model):
|
||||||
suspense_line = {
|
suspense_line = {
|
||||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||||
"id": False,
|
"id": False,
|
||||||
"account_id": self.journal_id.suspense_account_id.name_get()[0],
|
"account_id": self.journal_id.suspense_account_id.display_name,
|
||||||
"partner_id": self.partner_id
|
"partner_id": self.partner_id
|
||||||
and self.partner_id.name_get()[0]
|
and self.partner_id.display_name
|
||||||
or (False, self.partner_name),
|
or (False, self.partner_name),
|
||||||
"date": fields.Date.to_string(self.date),
|
"date": fields.Date.to_string(self.date),
|
||||||
"name": self.payment_ref or self.name,
|
"name": self.payment_ref or self.name,
|
||||||
|
@ -218,9 +218,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
)
|
)
|
||||||
or self.manual_account_id.id != line["account_id"][0]
|
or self.manual_account_id.id != line["account_id"][0]
|
||||||
or self.manual_name != line["name"]
|
or self.manual_name != line["name"]
|
||||||
or (
|
or (self.manual_partner_id and self.manual_partner_id.display_name or False)
|
||||||
self.manual_partner_id and self.manual_partner_id.name_get()[0] or False
|
|
||||||
)
|
|
||||||
!= line.get("partner_id")
|
!= line.get("partner_id")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -291,9 +289,9 @@ class AccountBankStatementLine(models.Model):
|
||||||
{
|
{
|
||||||
"name": self.manual_name,
|
"name": self.manual_name,
|
||||||
"partner_id": self.manual_partner_id
|
"partner_id": self.manual_partner_id
|
||||||
and self.manual_partner_id.name_get()[0]
|
and self.manual_partner_id.display_name
|
||||||
or (False, self.partner_name),
|
or (False, self.partner_name),
|
||||||
"account_id": self.manual_account_id.name_get()[0]
|
"account_id": self.manual_account_id.display_name
|
||||||
if self.manual_account_id
|
if self.manual_account_id
|
||||||
else [False, _("Undefined")],
|
else [False, _("Undefined")],
|
||||||
"amount": self.manual_amount,
|
"amount": self.manual_amount,
|
||||||
|
@ -378,7 +376,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
"kind": "other",
|
"kind": "other",
|
||||||
"account_id": self.env["account.account"]
|
"account_id": self.env["account.account"]
|
||||||
.browse(line["account_id"])
|
.browse(line["account_id"])
|
||||||
.name_get()[0],
|
.display_name,
|
||||||
"date": fields.Date.to_string(self.date),
|
"date": fields.Date.to_string(self.date),
|
||||||
"line_currency_id": self.company_id.currency_id.id,
|
"line_currency_id": self.company_id.currency_id.id,
|
||||||
"currency_id": self.company_id.currency_id.id,
|
"currency_id": self.company_id.currency_id.id,
|
||||||
|
@ -388,7 +386,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
reconcile_auxiliary_id += 1
|
reconcile_auxiliary_id += 1
|
||||||
if line.get("partner_id"):
|
if line.get("partner_id"):
|
||||||
new_line["partner_id"] = (
|
new_line["partner_id"] = (
|
||||||
self.env["res.partner"].browse(line["partner_id"]).name_get()[0]
|
self.env["res.partner"].browse(line["partner_id"]).display_name
|
||||||
)
|
)
|
||||||
new_data.append(new_line)
|
new_data.append(new_line)
|
||||||
return new_data, reconcile_auxiliary_id
|
return new_data, reconcile_auxiliary_id
|
||||||
|
@ -411,7 +409,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
{
|
{
|
||||||
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
||||||
"id": False,
|
"id": False,
|
||||||
"account_id": account.name_get()[0],
|
"account_id": account.display_name,
|
||||||
"partner_id": False,
|
"partner_id": False,
|
||||||
"date": fields.Date.to_string(self.date),
|
"date": fields.Date.to_string(self.date),
|
||||||
"name": self.payment_ref or self.name,
|
"name": self.payment_ref or self.name,
|
||||||
|
|
|
@ -68,8 +68,8 @@ class AccountReconcileAbstract(models.AbstractModel):
|
||||||
vals = {
|
vals = {
|
||||||
"reference": "account.move.line;%s" % line.id,
|
"reference": "account.move.line;%s" % line.id,
|
||||||
"id": line.id,
|
"id": line.id,
|
||||||
"account_id": line.account_id.name_get()[0],
|
"account_id": line.account_id.display_name,
|
||||||
"partner_id": line.partner_id and line.partner_id.name_get()[0] or False,
|
"partner_id": line.partner_id and line.partner_id.display_name or False,
|
||||||
"date": fields.Date.to_string(line.date),
|
"date": fields.Date.to_string(line.date),
|
||||||
"name": line.name,
|
"name": line.name,
|
||||||
"debit": amount if amount > 0 else 0.0,
|
"debit": amount if amount > 0 else 0.0,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/** @odoo-module **/
|
/** @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 {registry} from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
|
|
||||||
const {Component} = owl;
|
const {Component} = owl;
|
||||||
|
@ -8,7 +9,7 @@ const {Component} = owl;
|
||||||
export class AccountReconcileChatterWidget extends Component {}
|
export class AccountReconcileChatterWidget extends Component {}
|
||||||
AccountReconcileChatterWidget.template =
|
AccountReconcileChatterWidget.template =
|
||||||
"account_reconcile_oca.AccountReconcileChatterWidget";
|
"account_reconcile_oca.AccountReconcileChatterWidget";
|
||||||
AccountReconcileChatterWidget.components = {...Component.components, ChatterContainer};
|
// AccountReconcileChatterWidget.components = {...Component.components, ChatterContainer};
|
||||||
|
|
||||||
registry
|
registry
|
||||||
.category("fields")
|
.category("fields")
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/** @odoo-module **/
|
/** @odoo-module **/
|
||||||
|
|
||||||
import fieldUtils from "web.field_utils";
|
import {formatDate, formatMonetary} from "@web/views/fields/formatters";
|
||||||
|
import {parseDate} from "@web/core/l10n/dates";
|
||||||
import {registry} from "@web/core/registry";
|
import {registry} from "@web/core/registry";
|
||||||
import session from "web.session";
|
import {session} from "@web/session";
|
||||||
|
|
||||||
const {Component} = owl;
|
const {Component} = owl;
|
||||||
|
|
||||||
|
@ -22,28 +23,16 @@ export class AccountReconcileDataWidget extends Component {
|
||||||
getReconcileLines() {
|
getReconcileLines() {
|
||||||
var data = this.props.record.data[this.props.name].data;
|
var data = this.props.record.data[this.props.name].data;
|
||||||
for (var line in data) {
|
for (var line in data) {
|
||||||
data[line].amount_format = fieldUtils.format.monetary(
|
data[line].amount_format = formatMonetary(data[line].amount, undefined, {
|
||||||
data[line].amount,
|
currency: session.get_currency(data[line].currency_id),
|
||||||
undefined,
|
});
|
||||||
{
|
data[line].debit_format = formatMonetary(data[line].debit, undefined, {
|
||||||
currency: session.get_currency(data[line].currency_id),
|
currency: session.get_currency(data[line].currency_id),
|
||||||
}
|
});
|
||||||
);
|
data[line].credit_format = formatMonetary(data[line].credit, undefined, {
|
||||||
data[line].debit_format = fieldUtils.format.monetary(
|
currency: session.get_currency(data[line].currency_id),
|
||||||
data[line].debit,
|
});
|
||||||
undefined,
|
data[line].amount_currency_format = formatMonetary(
|
||||||
{
|
|
||||||
currency: session.get_currency(data[line].currency_id),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
data[line].credit_format = fieldUtils.format.monetary(
|
|
||||||
data[line].credit,
|
|
||||||
undefined,
|
|
||||||
{
|
|
||||||
currency: session.get_currency(data[line].currency_id),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
data[line].amount_currency_format = fieldUtils.format.monetary(
|
|
||||||
data[line].currency_amount,
|
data[line].currency_amount,
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
|
@ -51,7 +40,7 @@ export class AccountReconcileDataWidget extends Component {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (data[line].original_amount) {
|
if (data[line].original_amount) {
|
||||||
data[line].original_amount_format = fieldUtils.format.monetary(
|
data[line].original_amount_format = formatMonetary(
|
||||||
data[line].original_amount,
|
data[line].original_amount,
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
|
@ -59,8 +48,8 @@ export class AccountReconcileDataWidget extends Component {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
data[line].date_format = fieldUtils.format.date(
|
data[line].date_format = formatDate(
|
||||||
fieldUtils.parse.date(data[line].date, undefined, {isUTC: true})
|
parseDate(data[line].date, undefined, {isUTC: true})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
t-name="account_reconcile_oca.ReconcileRenderer"
|
t-name="account_reconcile_oca.ReconcileRenderer"
|
||||||
t-inherit="web.KanbanRenderer"
|
t-inherit="web.KanbanRenderer"
|
||||||
t-inherit-mode="primary"
|
t-inherit-mode="primary"
|
||||||
owl="1"
|
|
||||||
>
|
>
|
||||||
<xpath expr="div[hasclass('o_kanban_renderer')]" position="attributes">
|
<xpath expr="div[hasclass('o_kanban_renderer')]" position="attributes">
|
||||||
<attribute
|
<attribute
|
||||||
|
@ -23,7 +22,6 @@
|
||||||
t-name="account_reconcile_oca.ReconcileController"
|
t-name="account_reconcile_oca.ReconcileController"
|
||||||
t-inherit="web.KanbanView"
|
t-inherit="web.KanbanView"
|
||||||
t-inherit-mode="primary"
|
t-inherit-mode="primary"
|
||||||
owl="1"
|
|
||||||
>
|
>
|
||||||
<!-- we pass to the component the selected record -->
|
<!-- we pass to the component the selected record -->
|
||||||
<xpath expr="//Layout/t[2]" position="attributes">
|
<xpath expr="//Layout/t[2]" position="attributes">
|
||||||
|
@ -42,17 +40,17 @@
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="account_reconcile.ReconcileView.Buttons" owl="1">
|
<t t-name="account_reconcile.ReconcileView.Buttons">
|
||||||
<button
|
<button
|
||||||
t-on-click="onClickNewButton"
|
t-on-click="onClickNewButton"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
t-if="activeActions.create"
|
t-if="activeActions.create"
|
||||||
>Create</button>
|
>Create</button>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="account_reconcile_oca.ReconcileMatchWidget" owl="1">
|
<t t-name="account_reconcile_oca.ReconcileMatchWidget">
|
||||||
<View t-props="listViewProperties" />
|
<View t-props="listViewProperties" />
|
||||||
</t>
|
</t>
|
||||||
<t t-name="account_reconcile_oca.ReconcileDataWidget" owl="1">
|
<t t-name="account_reconcile_oca.ReconcileDataWidget">
|
||||||
<table
|
<table
|
||||||
class="table table-sm position-relative mb-0 table-striped o_reconcile_widget_table"
|
class="table table-sm position-relative mb-0 table-striped o_reconcile_widget_table"
|
||||||
style="table-layout: auto"
|
style="table-layout: auto"
|
||||||
|
@ -138,7 +136,7 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="account_reconcile_oca.AccountReconcileChatterWidget" owl="1">
|
<t t-name="account_reconcile_oca.AccountReconcileChatterWidget">
|
||||||
<ChatterContainer
|
<ChatterContainer
|
||||||
threadModel="this.props.record.fields[this.props.name].relation"
|
threadModel="this.props.record.fields[this.props.name].relation"
|
||||||
threadId="this.props.value[0]"
|
threadId="this.props.value[0]"
|
||||||
|
@ -148,7 +146,6 @@
|
||||||
t-name="account_reconcile_oca.ReconcileMoveLineController"
|
t-name="account_reconcile_oca.ReconcileMoveLineController"
|
||||||
t-inherit="web.ListView"
|
t-inherit="web.ListView"
|
||||||
t-inherit-mode="primary"
|
t-inherit-mode="primary"
|
||||||
owl="1"
|
|
||||||
>
|
>
|
||||||
<xpath expr="//t[@list='model.root']" position="attributes">
|
<xpath expr="//t[@list='model.root']" position="attributes">
|
||||||
<attribute name="parentRecord">props.parentRecord</attribute>
|
<attribute name="parentRecord">props.parentRecord</attribute>
|
||||||
|
|
|
@ -98,7 +98,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
) as f:
|
) as f:
|
||||||
self.assertFalse(f.can_reconcile)
|
self.assertFalse(f.can_reconcile)
|
||||||
f.add_account_move_line_id = inv1.line_ids.filtered(
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
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)
|
||||||
|
@ -130,7 +130,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -184,7 +184,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
) as f:
|
) as f:
|
||||||
self.assertFalse(f.can_reconcile)
|
self.assertFalse(f.can_reconcile)
|
||||||
f.add_account_move_line_id = inv1.line_ids.filtered(
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
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)
|
||||||
|
@ -238,10 +238,10 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
receivable2 = inv2.line_ids.filtered(
|
receivable2 = inv2.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -298,10 +298,10 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "liability_payable"
|
lambda line: line.account_id.account_type == "liability_payable"
|
||||||
)
|
)
|
||||||
receivable2 = inv2.line_ids.filtered(
|
receivable2 = inv2.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "liability_payable"
|
lambda line: line.account_id.account_type == "liability_payable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -419,7 +419,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
inv1 = self.create_invoice(currency_id=self.currency_euro_id)
|
inv1 = self.create_invoice(currency_id=self.currency_euro_id)
|
||||||
|
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
bank_stmt = self.acc_bank_stmt_model.create(
|
bank_stmt = self.acc_bank_stmt_model.create(
|
||||||
{
|
{
|
||||||
|
@ -525,7 +525,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -572,7 +572,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -649,7 +649,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -687,7 +687,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
with Form(
|
with Form(
|
||||||
bank_stmt_line,
|
bank_stmt_line,
|
||||||
|
@ -733,12 +733,12 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
) as f:
|
) as f:
|
||||||
self.assertFalse(f.can_reconcile)
|
self.assertFalse(f.can_reconcile)
|
||||||
f.add_account_move_line_id = inv1.line_ids.filtered(
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
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.add_account_move_line_id = inv1.line_ids.filtered(
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
self.assertFalse(f.add_account_move_line_id)
|
self.assertFalse(f.add_account_move_line_id)
|
||||||
self.assertFalse(f.can_reconcile)
|
self.assertFalse(f.can_reconcile)
|
||||||
|
@ -873,11 +873,11 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
partner = inv1.partner_id
|
partner = inv1.partner_id
|
||||||
|
|
||||||
receivable1 = inv1.line_ids.filtered(
|
receivable1 = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
self.assertTrue(receivable1)
|
self.assertTrue(receivable1)
|
||||||
receivable2 = inv2.line_ids.filtered(
|
receivable2 = inv2.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
self.assertTrue(receivable2)
|
self.assertTrue(receivable2)
|
||||||
|
|
||||||
|
@ -1000,7 +1000,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
||||||
) as f:
|
) as f:
|
||||||
self.assertFalse(f.can_reconcile)
|
self.assertFalse(f.can_reconcile)
|
||||||
f.add_account_move_line_id = inv1.line_ids.filtered(
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
||||||
lambda l: l.account_id.account_type == "asset_receivable"
|
lambda line: line.account_id.account_type == "asset_receivable"
|
||||||
)
|
)
|
||||||
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)
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
<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">
|
||||||
<button name="action_read_account" position="after">
|
<tree 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"
|
||||||
string="Reconcile"
|
string="Reconcile"
|
||||||
class="float-end btn-secondary"
|
class="float-end btn-secondary"
|
||||||
attrs="{'invisible': [('reconcile', '=', False)]}"
|
invisible="reconcile == False"
|
||||||
/>
|
/>
|
||||||
</button>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
type="object"
|
type="object"
|
||||||
string="Reconcile"
|
string="Reconcile"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="clean_reconcile"
|
name="clean_reconcile"
|
||||||
type="object"
|
type="object"
|
||||||
string="Clean"
|
string="Clean"
|
||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
<page
|
<page
|
||||||
name="reconcile_line"
|
name="reconcile_line"
|
||||||
string="Reconcile"
|
string="Reconcile"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
>
|
>
|
||||||
<field
|
<field
|
||||||
name="add_account_move_line_id"
|
name="add_account_move_line_id"
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
<field name="name">Reconcile</field>
|
<field name="name">Reconcile</field>
|
||||||
<field name="res_model">account.account.reconcile</field>
|
<field name="res_model">account.account.reconcile</field>
|
||||||
<field name="view_mode">kanban</field>
|
<field name="view_mode">kanban</field>
|
||||||
<field name="domain">[("partner_id", "=", active_id)]</field>
|
<field name="domain">[("partner_id", "=", id)]</field>
|
||||||
<field
|
<field
|
||||||
name="context"
|
name="context"
|
||||||
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
<field name="name">Reconcile</field>
|
<field name="name">Reconcile</field>
|
||||||
<field name="res_model">account.account.reconcile</field>
|
<field name="res_model">account.account.reconcile</field>
|
||||||
<field name="view_mode">kanban</field>
|
<field name="view_mode">kanban</field>
|
||||||
<field name="domain">[("account_id", "=", active_id)]</field>
|
<field name="domain">[("account_id", "=", id)]</field>
|
||||||
<field
|
<field
|
||||||
name="context"
|
name="context"
|
||||||
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
||||||
|
|
|
@ -131,14 +131,14 @@
|
||||||
string="Validate"
|
string="Validate"
|
||||||
accesskey="v"
|
accesskey="v"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
attrs="{'invisible': ['|', ('is_reconciled', '=', True), ('can_reconcile', '=', False)]}"
|
invisible="is_reconciled == True or can_reconcile == False"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="reconcile_bank_line"
|
name="reconcile_bank_line"
|
||||||
type="object"
|
type="object"
|
||||||
string="Reconcile"
|
string="Reconcile"
|
||||||
class="btn btn-primary disabled"
|
class="btn btn-primary disabled"
|
||||||
attrs="{'invisible': ['|', ('is_reconciled', '=', True), ('can_reconcile', '=', True)]}"
|
invisible="is_reconciled == True or can_reconcile == True"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="unreconcile_bank_line"
|
name="unreconcile_bank_line"
|
||||||
|
@ -146,7 +146,7 @@
|
||||||
string="Unreconcile"
|
string="Unreconcile"
|
||||||
accesskey="r"
|
accesskey="r"
|
||||||
class="btn btn-warning"
|
class="btn btn-warning"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', False)]}"
|
invisible="is_reconciled == False"
|
||||||
confirm="Are you sure that the move should be unreconciled?"
|
confirm="Are you sure that the move should be unreconciled?"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
@ -154,7 +154,7 @@
|
||||||
type="object"
|
type="object"
|
||||||
string="Reset reconciliation"
|
string="Reset reconciliation"
|
||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="action_to_check"
|
name="action_to_check"
|
||||||
|
@ -162,14 +162,14 @@
|
||||||
class="btn btn-secondary"
|
class="btn btn-secondary"
|
||||||
accesskey="c"
|
accesskey="c"
|
||||||
type="object"
|
type="object"
|
||||||
attrs="{'invisible': [('to_check', '=', True)]}"
|
invisible="to_check == True"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="action_checked"
|
name="action_checked"
|
||||||
string="Set as Checked"
|
string="Set as Checked"
|
||||||
accesskey="c"
|
accesskey="c"
|
||||||
type="object"
|
type="object"
|
||||||
attrs="{'invisible': [('to_check', '=', False)]}"
|
invisible="to_check == False"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
name="action_show_move"
|
name="action_show_move"
|
||||||
|
@ -205,14 +205,14 @@
|
||||||
name="manual_model_id"
|
name="manual_model_id"
|
||||||
widget="selection_badge_uncheck"
|
widget="selection_badge_uncheck"
|
||||||
nolabel="1"
|
nolabel="1"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page
|
<page
|
||||||
name="reconcile_line"
|
name="reconcile_line"
|
||||||
string="Reconcile"
|
string="Reconcile"
|
||||||
attrs="{'invisible': [('is_reconciled', '=', True)]}"
|
invisible="is_reconciled == True"
|
||||||
>
|
>
|
||||||
<field
|
<field
|
||||||
name="add_account_move_line_id"
|
name="add_account_move_line_id"
|
||||||
|
@ -229,31 +229,32 @@
|
||||||
<field
|
<field
|
||||||
name="manual_account_id"
|
name="manual_account_id"
|
||||||
string="Account"
|
string="Account"
|
||||||
attrs="{'readonly': ['|', '|', ('manual_reference', '=', False), ('is_reconciled', '=', True), ('manual_line_id', '!=', False)]}"
|
readonly="manual_reference == False or is_reconciled == True or manual_line_id != False"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="manual_partner_id"
|
name="manual_partner_id"
|
||||||
string="Partner"
|
string="Partner"
|
||||||
attrs="{'readonly': ['|', '|', ('manual_reference', '=', False), ('is_reconciled', '=', True), '&', ('manual_line_id', '!=', False), ('manual_kind', '!=', 'liquidity')]}"
|
readonly="manual_reference == False or is_reconciled == True or (manual_line_id != False and manual_kind != 'liquidity')"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="analytic_distribution"
|
name="analytic_distribution"
|
||||||
widget="analytic_distribution"
|
widget="analytic_distribution"
|
||||||
groups="analytic.group_analytic_accounting"
|
groups="analytic.group_analytic_accounting"
|
||||||
options="{'account_field': 'manual_account_id', 'business_domain': 'general'}"
|
options="{'account_field': 'manual_account_id', 'business_domain': 'general'}"
|
||||||
attrs="{'invisible': ['|', ('manual_kind', '=', 'liquidity'), ('manual_reference', '=', False)], 'readonly': [('is_reconciled', '=', True)]}"
|
invisible="manual_kind == 'liquidity' or manual_reference == False"
|
||||||
|
readonly="is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field
|
||||||
name="manual_name"
|
name="manual_name"
|
||||||
string="Name"
|
string="Name"
|
||||||
attrs="{'readonly': ['|', '|', ('manual_reference', '=', False), ('is_reconciled', '=', True), '&', ('manual_line_id', '!=', False), ('manual_kind', '!=', 'liquidity')]}"
|
readonly="manual_reference == False or is_reconciled == True or (manual_line_id != False and manual_kind != 'liquidity')"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="manual_amount"
|
name="manual_amount"
|
||||||
string="Amount"
|
string="Amount"
|
||||||
attrs="{'readonly': ['|', ('manual_reference', '=', False), ('is_reconciled', '=', True)]}"
|
readonly="manual_reference == False or is_reconciled == True"
|
||||||
/>
|
/>
|
||||||
<field name="manual_currency_id" invisible="1" />
|
<field name="manual_currency_id" invisible="1" />
|
||||||
<field name="manual_original_amount" invisible="1" />
|
<field name="manual_original_amount" invisible="1" />
|
||||||
|
@ -261,10 +262,10 @@
|
||||||
<label
|
<label
|
||||||
for="manual_move_id"
|
for="manual_move_id"
|
||||||
string=""
|
string=""
|
||||||
attrs="{'invisible': ['|', ('manual_move_type', 'not in', ['in_invoice', 'in_refund', 'out_invoice', 'out_refund']), ('manual_original_amount', '=', 0)]}"
|
insible="manual_move_type not in ['in_invoice', 'in_refund', 'out_invoice', 'out_refund'] or manual_original_amount == 0"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
attrs="{'invisible': ['|', ('manual_move_type', 'not in', ['in_invoice', 'in_refund', 'out_invoice', 'out_refund']), ('manual_original_amount', '=', 0)]}"
|
insible="manual_move_type not in ['in_invoice', 'in_refund', 'out_invoice', 'out_refund'] or manual_original_amount == 0"
|
||||||
>
|
>
|
||||||
Invoice <field
|
Invoice <field
|
||||||
class="oe_inline"
|
class="oe_inline"
|
||||||
|
@ -293,7 +294,7 @@
|
||||||
<field name="narration" />
|
<field name="narration" />
|
||||||
</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" /> -->
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</form>
|
</form>
|
||||||
|
@ -303,9 +304,9 @@
|
||||||
<field name="name">Reconcile bank statement lines</field>
|
<field name="name">Reconcile bank statement lines</field>
|
||||||
<field name="res_model">account.bank.statement.line</field>
|
<field name="res_model">account.bank.statement.line</field>
|
||||||
<field name="domain">[('journal_id', '=', active_id)]</field>
|
<field name="domain">[('journal_id', '=', active_id)]</field>
|
||||||
<field
|
<field name="context">
|
||||||
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">tree</field>
|
<field name="view_mode">tree</field>
|
||||||
<field
|
<field
|
||||||
name="view_ids"
|
name="view_ids"
|
||||||
|
@ -322,9 +323,9 @@
|
||||||
<field name="name">Reconcile bank statement lines</field>
|
<field name="name">Reconcile bank statement lines</field>
|
||||||
<field name="res_model">account.bank.statement.line</field>
|
<field name="res_model">account.bank.statement.line</field>
|
||||||
<field name="domain">[('journal_id', '=', active_id)]</field>
|
<field name="domain">[('journal_id', '=', active_id)]</field>
|
||||||
<field
|
<field name="context">
|
||||||
name="context"
|
{'default_journal_id': active_id, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}
|
||||||
>{'default_journal_id': active_id, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}</field>
|
</field>
|
||||||
<field name="view_mode">tree</field>
|
<field name="view_mode">tree</field>
|
||||||
<field
|
<field
|
||||||
name="view_ids"
|
name="view_ids"
|
||||||
|
@ -344,9 +345,9 @@
|
||||||
<field name="name">Reconcile bank statement lines</field>
|
<field name="name">Reconcile bank statement lines</field>
|
||||||
<field name="res_model">account.bank.statement.line</field>
|
<field name="res_model">account.bank.statement.line</field>
|
||||||
<field name="domain">[('journal_id', '=', active_id)]</field>
|
<field name="domain">[('journal_id', '=', active_id)]</field>
|
||||||
<field
|
<field name="context">
|
||||||
name="context"
|
{'default_journal_id': active_id, 'search_default_to_check': True, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}
|
||||||
>{'default_journal_id': active_id, 'search_default_to_check': True, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}</field>
|
</field>
|
||||||
<field name="view_mode">tree</field>
|
<field name="view_mode">tree</field>
|
||||||
<field
|
<field
|
||||||
name="view_ids"
|
name="view_ids"
|
||||||
|
@ -366,7 +367,7 @@
|
||||||
>
|
>
|
||||||
<field name="name">Reconcile bank statement lines</field>
|
<field name="name">Reconcile bank statement lines</field>
|
||||||
<field name="res_model">account.bank.statement.line</field>
|
<field name="res_model">account.bank.statement.line</field>
|
||||||
<field name="context">{'search_default_move_id': active_id}</field>
|
<field name="context">{'search_default_move_id': id}</field>
|
||||||
<field name="view_mode">tree</field>
|
<field name="view_mode">tree</field>
|
||||||
<field
|
<field
|
||||||
name="view_ids"
|
name="view_ids"
|
||||||
|
|
|
@ -4,14 +4,15 @@
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="view_account_journal_form" model="ir.ui.view">
|
<record id="view_account_journal_form" model="ir.ui.view">
|
||||||
<field name="name">account.journal.inherit.dashboard.kanban</field>
|
<field name="name">account.journal.form.inherit</field>
|
||||||
<field name="model">account.journal</field>
|
<field name="model">account.journal</field>
|
||||||
<field name="inherit_id" ref="account.view_account_journal_form" />
|
<field name="inherit_id" ref="account.view_account_journal_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="suspense_account_id" position="before">
|
<field name="suspense_account_id" position="before">
|
||||||
<field
|
<field
|
||||||
name="reconcile_mode"
|
name="reconcile_mode"
|
||||||
attrs="{'required': [('type', 'in', ('bank', 'cash'))], 'invisible': [('type', 'not in', ('bank', 'cash'))]}"
|
required="type in ('bank', 'cash')"
|
||||||
|
invisible="type not in ('bank', 'cash')"
|
||||||
options="{'no_quick_create': True}"
|
options="{'no_quick_create': True}"
|
||||||
groups="account.group_account_readonly"
|
groups="account.group_account_readonly"
|
||||||
/>
|
/>
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||||
<field name="name">account.journal.inherit.dashboard.kanban</field>
|
<field name="name">account.journal.kanban.inherit</field>
|
||||||
<field name="model">account.journal</field>
|
<field name="model">account.journal</field>
|
||||||
<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">
|
||||||
|
@ -59,7 +60,7 @@
|
||||||
</t>
|
</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//div[@id='card_action_view_menus']" position="after">
|
<xpath expr="//h5[@id='card_action_view_menus']" position="after">
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
string="Bank reconcile"
|
string="Bank reconcile"
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
icon="fa-list"
|
icon="fa-list"
|
||||||
attrs="{'invisible': [('statement_line_id', '=', False)]}"
|
invisible="statement_line_id == False"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</field>
|
</field>
|
||||||
|
|
Loading…
Reference in New Issue