odoo-addon-account-reconcile-oca 16.0.1.2.12.3__py3-none-any.whl → 17.0.1.0.0.21__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/account_reconcile_oca/README.rst +19 -18
- odoo/addons/account_reconcile_oca/__manifest__.py +4 -1
- odoo/addons/account_reconcile_oca/hooks.py +2 -2
- odoo/addons/account_reconcile_oca/i18n/account_reconcile_oca.pot +89 -8
- odoo/addons/account_reconcile_oca/i18n/ca.po +91 -7
- odoo/addons/account_reconcile_oca/i18n/es.po +94 -10
- odoo/addons/account_reconcile_oca/i18n/fr.po +91 -7
- odoo/addons/account_reconcile_oca/i18n/hr.po +91 -7
- odoo/addons/account_reconcile_oca/i18n/nl.po +91 -7
- odoo/addons/account_reconcile_oca/i18n/pt_BR.po +91 -7
- odoo/addons/account_reconcile_oca/i18n/sv.po +126 -42
- odoo/addons/account_reconcile_oca/i18n/tr.po +91 -7
- odoo/addons/account_reconcile_oca/models/__init__.py +3 -0
- odoo/addons/account_reconcile_oca/models/account_account_reconcile.py +2 -2
- odoo/addons/account_reconcile_oca/models/account_bank_statement.py +15 -0
- odoo/addons/account_reconcile_oca/models/account_bank_statement_line.py +98 -19
- odoo/addons/account_reconcile_oca/models/account_journal.py +15 -1
- odoo/addons/account_reconcile_oca/models/account_move_line.py +0 -1
- odoo/addons/account_reconcile_oca/models/account_reconcile_abstract.py +4 -2
- odoo/addons/account_reconcile_oca/models/res_company.py +14 -0
- odoo/addons/account_reconcile_oca/models/res_config_settings.py +12 -0
- odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.md +1 -0
- odoo/addons/account_reconcile_oca/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -1
- odoo/addons/account_reconcile_oca/readme/ROADMAP.md +3 -0
- odoo/addons/account_reconcile_oca/readme/USAGE.md +10 -0
- odoo/addons/account_reconcile_oca/static/description/index.html +10 -9
- odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +44 -4
- odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_renderer.esm.js +52 -1
- odoo/addons/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +3 -0
- odoo/addons/account_reconcile_oca/static/src/js/reconcile_manual/reconcile_manual_controller.esm.js +3 -0
- odoo/addons/account_reconcile_oca/static/src/js/reconcile_move_line/reconcile_move_line_renderer.esm.js +1 -1
- odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js +11 -4
- odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +22 -33
- odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_move_line_widget.esm.js +62 -6
- odoo/addons/account_reconcile_oca/static/src/js/widgets/selection_badge_uncheck.esm.js +10 -1
- odoo/addons/account_reconcile_oca/static/src/scss/reconcile.scss +16 -15
- odoo/addons/account_reconcile_oca/static/src/xml/reconcile.xml +44 -10
- odoo/addons/account_reconcile_oca/tests/test_account_reconcile.py +15 -9
- odoo/addons/account_reconcile_oca/tests/test_bank_account_reconcile.py +28 -21
- odoo/addons/account_reconcile_oca/views/account_account.xml +3 -3
- odoo/addons/account_reconcile_oca/views/account_account_reconcile.xml +7 -7
- odoo/addons/account_reconcile_oca/views/account_bank_statement.xml +46 -0
- odoo/addons/account_reconcile_oca/views/account_bank_statement_line.xml +71 -37
- odoo/addons/account_reconcile_oca/views/account_journal.xml +10 -4
- odoo/addons/account_reconcile_oca/views/account_move.xml +1 -1
- odoo/addons/account_reconcile_oca/views/account_move_line.xml +8 -3
- odoo/addons/account_reconcile_oca/views/res_config_settings.xml +24 -0
- {odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.21.dist-info}/METADATA +27 -28
- odoo_addon_account_reconcile_oca-17.0.1.0.0.21.dist-info/RECORD +64 -0
- {odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.21.dist-info}/WHEEL +1 -1
- odoo_addon_account_reconcile_oca-17.0.1.0.0.21.dist-info/top_level.txt +1 -0
- odoo/addons/account_reconcile_oca/i18n/it.po +0 -598
- odoo/addons/account_reconcile_oca/migrations/16.0.1.2.0/pre-migration.py +0 -23
- odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.rst +0 -1
- odoo/addons/account_reconcile_oca/readme/ROADMAP.rst +0 -3
- odoo/addons/account_reconcile_oca/readme/USAGE.rst +0 -12
- odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info/RECORD +0 -61
- odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info/top_level.txt +0 -1
@@ -1,19 +1,29 @@
|
|
1
1
|
/** @odoo-module **/
|
2
2
|
|
3
3
|
import {View} from "@web/views/view";
|
4
|
+
import {evaluateBooleanExpr} from "@web/core/py_js/py";
|
5
|
+
import {getFieldContext} from "@web/model/relational_model/utils";
|
4
6
|
import {registry} from "@web/core/registry";
|
7
|
+
import {standardFieldProps} from "@web/views/fields/standard_field_props";
|
5
8
|
|
6
9
|
const {Component, useSubEnv} = owl;
|
7
10
|
|
8
11
|
export class AccountReconcileMatchWidget extends Component {
|
9
12
|
setup() {
|
10
13
|
// Necessary in order to avoid a loop
|
11
|
-
super.setup(...arguments);
|
12
14
|
useSubEnv({
|
13
15
|
config: {},
|
14
16
|
parentController: this.env.parentController,
|
15
17
|
});
|
16
18
|
}
|
19
|
+
|
20
|
+
getDomain() {
|
21
|
+
let domain = this.props.domain;
|
22
|
+
if (typeof domain === "function") {
|
23
|
+
domain = domain();
|
24
|
+
}
|
25
|
+
return domain;
|
26
|
+
}
|
17
27
|
get listViewProperties() {
|
18
28
|
return {
|
19
29
|
type: "list",
|
@@ -22,15 +32,18 @@ export class AccountReconcileMatchWidget extends Component {
|
|
22
32
|
// Hiding the control panel buttons
|
23
33
|
"top-left": false,
|
24
34
|
"bottom-left": false,
|
35
|
+
layoutActions: false,
|
25
36
|
},
|
26
37
|
},
|
38
|
+
noBreadcrumbs: true,
|
27
39
|
resModel: this.props.record.fields[this.props.name].relation,
|
28
40
|
searchMenuTypes: ["filter"],
|
29
|
-
domain: this.
|
41
|
+
domain: this.getDomain(),
|
30
42
|
context: {
|
31
|
-
...this.props.
|
43
|
+
...this.props.context,
|
44
|
+
...getFieldContext(this.props.record, this.props.name),
|
32
45
|
},
|
33
|
-
// Disables
|
46
|
+
// Disables selector
|
34
47
|
allowSelectors: false,
|
35
48
|
// We need to force the search view in order to show the right one
|
36
49
|
searchViewId: false,
|
@@ -39,13 +52,56 @@ export class AccountReconcileMatchWidget extends Component {
|
|
39
52
|
};
|
40
53
|
}
|
41
54
|
}
|
55
|
+
AccountReconcileMatchWidget.props = {
|
56
|
+
...standardFieldProps,
|
57
|
+
placeholder: {type: String, optional: true},
|
58
|
+
canOpen: {type: Boolean, optional: true},
|
59
|
+
canCreate: {type: Boolean, optional: true},
|
60
|
+
canWrite: {type: Boolean, optional: true},
|
61
|
+
canQuickCreate: {type: Boolean, optional: true},
|
62
|
+
canCreateEdit: {type: Boolean, optional: true},
|
63
|
+
context: {type: String, optional: true},
|
64
|
+
domain: {type: [Array, Function], optional: true},
|
65
|
+
nameCreateField: {type: String, optional: true},
|
66
|
+
searchLimit: {type: Number, optional: true},
|
67
|
+
relation: {type: String, optional: true},
|
68
|
+
string: {type: String, optional: true},
|
69
|
+
canScanBarcode: {type: Boolean, optional: true},
|
70
|
+
update: {type: Function, optional: true},
|
71
|
+
value: {optional: true},
|
72
|
+
decorations: {type: Object, optional: true},
|
73
|
+
};
|
42
74
|
AccountReconcileMatchWidget.template = "account_reconcile_oca.ReconcileMatchWidget";
|
43
|
-
|
44
75
|
AccountReconcileMatchWidget.components = {
|
45
76
|
...AccountReconcileMatchWidget.components,
|
46
77
|
View,
|
47
78
|
};
|
48
79
|
|
80
|
+
export const AccountReconcileMatchWidgetField = {
|
81
|
+
component: AccountReconcileMatchWidget,
|
82
|
+
supportedTypes: [],
|
83
|
+
extractProps({attrs, context, decorations, options}, dynamicInfo) {
|
84
|
+
const hasCreatePermission = attrs.can_create
|
85
|
+
? evaluateBooleanExpr(attrs.can_create)
|
86
|
+
: true;
|
87
|
+
const hasWritePermission = attrs.can_write
|
88
|
+
? evaluateBooleanExpr(attrs.can_write)
|
89
|
+
: true;
|
90
|
+
const canCreate = options.no_create ? false : hasCreatePermission;
|
91
|
+
return {
|
92
|
+
placeholder: attrs.placeholder,
|
93
|
+
canOpen: !options.no_open,
|
94
|
+
canCreate,
|
95
|
+
canWrite: hasWritePermission,
|
96
|
+
canQuickCreate: canCreate && !options.no_quick_create,
|
97
|
+
canCreateEdit: canCreate && !options.no_create_edit,
|
98
|
+
context: context,
|
99
|
+
decorations,
|
100
|
+
domain: dynamicInfo.domain,
|
101
|
+
};
|
102
|
+
},
|
103
|
+
};
|
104
|
+
|
49
105
|
registry
|
50
106
|
.category("fields")
|
51
|
-
.add("account_reconcile_oca_match",
|
107
|
+
.add("account_reconcile_oca_match", AccountReconcileMatchWidgetField);
|
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
preloadSelection,
|
5
5
|
} from "@web/views/fields/badge_selection/badge_selection_field";
|
6
6
|
import {registry} from "@web/core/registry";
|
7
|
+
import {standardFieldProps} from "@web/views/fields/standard_field_props";
|
7
8
|
|
8
9
|
export class FieldSelectionBadgeUncheck extends BadgeSelectionField {
|
9
10
|
async onChange(value) {
|
@@ -19,9 +20,17 @@ export class FieldSelectionBadgeUncheck extends BadgeSelectionField {
|
|
19
20
|
}
|
20
21
|
}
|
21
22
|
|
23
|
+
FieldSelectionBadgeUncheck.props = {...standardFieldProps};
|
22
24
|
FieldSelectionBadgeUncheck.supportedTypes = ["many2one", "selection"];
|
23
25
|
FieldSelectionBadgeUncheck.additionalClasses = ["o_field_selection_badge"];
|
24
|
-
|
26
|
+
|
27
|
+
export const FieldSelectionBadgeUncheckField = {
|
28
|
+
component: FieldSelectionBadgeUncheck,
|
29
|
+
supportedTypes: ["many2one"],
|
30
|
+
};
|
31
|
+
registry
|
32
|
+
.category("fields")
|
33
|
+
.add("selection_badge_uncheck", FieldSelectionBadgeUncheckField);
|
25
34
|
|
26
35
|
registry.category("preloadedData").add("selection_badge_uncheck", {
|
27
36
|
loadOnTypes: ["many2one"],
|
@@ -6,7 +6,23 @@
|
|
6
6
|
flex-flow: row wrap;
|
7
7
|
height: 100%;
|
8
8
|
.o_kanban_renderer.o_kanban_ungrouped .o_kanban_record {
|
9
|
+
&:hover {
|
10
|
+
.o_reconcile_create_statement {
|
11
|
+
opacity: 100;
|
12
|
+
}
|
13
|
+
}
|
9
14
|
margin: 0 0 0;
|
15
|
+
min-width: fit-content;
|
16
|
+
width: 100%;
|
17
|
+
.o_reconcile_create_statement {
|
18
|
+
position: absolute;
|
19
|
+
height: 4px;
|
20
|
+
margin: 0;
|
21
|
+
padding: 2px 0 0 0;
|
22
|
+
border: 0;
|
23
|
+
top: -14px;
|
24
|
+
opacity: 0;
|
25
|
+
}
|
10
26
|
> div {
|
11
27
|
border-right: thick solid rgba(0, 0, 0, 0);
|
12
28
|
}
|
@@ -26,23 +42,8 @@
|
|
26
42
|
height: 100%;
|
27
43
|
}
|
28
44
|
.o_form_view {
|
29
|
-
.btn-info:not(.dropdown-toggle):not(.dropdown-item) {
|
30
|
-
text-transform: uppercase;
|
31
|
-
}
|
32
45
|
.o_form_statusbar.o_account_reconcile_oca_statusbar {
|
33
|
-
.btn:not(.dropdown-toggle):not(.dropdown-item) {
|
34
|
-
text-transform: uppercase;
|
35
|
-
}
|
36
46
|
height: 40px;
|
37
|
-
> .o_statusbar_buttons {
|
38
|
-
height: 100%;
|
39
|
-
> .btn {
|
40
|
-
margin: 0;
|
41
|
-
height: 100%;
|
42
|
-
padding: 10px;
|
43
|
-
border-radius: 0;
|
44
|
-
}
|
45
|
-
}
|
46
47
|
}
|
47
48
|
.o_field_account_reconcile_oca_data {
|
48
49
|
.o_field_account_reconcile_oca_balance_float {
|
@@ -4,8 +4,44 @@
|
|
4
4
|
t-name="account_reconcile_oca.ReconcileRenderer"
|
5
5
|
t-inherit="web.KanbanRenderer"
|
6
6
|
t-inherit-mode="primary"
|
7
|
-
owl="1"
|
8
7
|
>
|
8
|
+
<xpath expr="//t[@t-as='groupOrRecord']" position="before">
|
9
|
+
<div class="m-2 d-flex w-100" t-if="env.parentController.journalId">
|
10
|
+
<span
|
11
|
+
class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
|
12
|
+
>Global Balance</span>
|
13
|
+
<span
|
14
|
+
class="pe-0 fw-bold fs-4 align-self-center"
|
15
|
+
t-esc="env.parentController.journalBalanceStr"
|
16
|
+
/>
|
17
|
+
</div>
|
18
|
+
<t t-set="aggregates" t-value="getAggregates()" />
|
19
|
+
</xpath>
|
20
|
+
<xpath expr="//t[@t-else='']/KanbanRecord" position="before">
|
21
|
+
<t
|
22
|
+
t-if="aggregates.length and groupOrRecord.record.data.aggregate_id and aggregates[0].id == groupOrRecord.record.data.aggregate_id"
|
23
|
+
>
|
24
|
+
<t t-set="aggregate" t-value="aggregates.shift()" />
|
25
|
+
<div class="m-2 d-flex w-100">
|
26
|
+
<span
|
27
|
+
class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
|
28
|
+
t-esc="aggregate.name"
|
29
|
+
/>
|
30
|
+
<span
|
31
|
+
t-if="groupOrRecord.record.data.reconcile_aggregate == 'statement'"
|
32
|
+
t-on-click="() => this.onClickStatement(aggregate.id)"
|
33
|
+
class="pe-0 fw-bold fs-4 align-self-center btn btn-link"
|
34
|
+
t-esc="aggregate.balanceStr"
|
35
|
+
/>
|
36
|
+
<!--
|
37
|
+
<span
|
38
|
+
t-if="groupOrRecord.record.data.reconcile_aggregate != 'statement'"
|
39
|
+
class="pe-0 fw-bold fs-4 align-self-center text-link"
|
40
|
+
t-esc="aggregate.balanceStr"
|
41
|
+
/>-->
|
42
|
+
</div>
|
43
|
+
</t>
|
44
|
+
</xpath>
|
9
45
|
<xpath expr="div[hasclass('o_kanban_renderer')]" position="attributes">
|
10
46
|
<attribute
|
11
47
|
name="class"
|
@@ -23,7 +59,6 @@
|
|
23
59
|
t-name="account_reconcile_oca.ReconcileController"
|
24
60
|
t-inherit="web.KanbanView"
|
25
61
|
t-inherit-mode="primary"
|
26
|
-
owl="1"
|
27
62
|
>
|
28
63
|
<!-- we pass to the component the selected record -->
|
29
64
|
<xpath expr="//Layout/t[2]" position="attributes">
|
@@ -42,17 +77,17 @@
|
|
42
77
|
</div>
|
43
78
|
</xpath>
|
44
79
|
</t>
|
45
|
-
<t t-name="account_reconcile.ReconcileView.Buttons"
|
80
|
+
<t t-name="account_reconcile.ReconcileView.Buttons">
|
46
81
|
<button
|
47
82
|
t-on-click="onClickNewButton"
|
48
83
|
class="btn btn-primary"
|
49
84
|
t-if="activeActions.create"
|
50
85
|
>Create</button>
|
51
86
|
</t>
|
52
|
-
<t t-name="account_reconcile_oca.ReconcileMatchWidget"
|
53
|
-
<View t-props="listViewProperties" />
|
87
|
+
<t t-name="account_reconcile_oca.ReconcileMatchWidget">
|
88
|
+
<View t-props="this.listViewProperties" />
|
54
89
|
</t>
|
55
|
-
<t t-name="account_reconcile_oca.ReconcileDataWidget"
|
90
|
+
<t t-name="account_reconcile_oca.ReconcileDataWidget">
|
56
91
|
<table
|
57
92
|
class="table table-sm position-relative mb-0 table-striped o_reconcile_widget_table"
|
58
93
|
style="table-layout: auto"
|
@@ -138,17 +173,16 @@
|
|
138
173
|
</tbody>
|
139
174
|
</table>
|
140
175
|
</t>
|
141
|
-
<t t-name="account_reconcile_oca.AccountReconcileChatterWidget"
|
142
|
-
<
|
176
|
+
<t t-name="account_reconcile_oca.AccountReconcileChatterWidget">
|
177
|
+
<Chatter
|
143
178
|
threadModel="this.props.record.fields[this.props.name].relation"
|
144
|
-
threadId="this.props.
|
179
|
+
threadId="this.props.record.data[this.props.name][0]"
|
145
180
|
/>
|
146
181
|
</t>
|
147
182
|
<t
|
148
183
|
t-name="account_reconcile_oca.ReconcileMoveLineController"
|
149
184
|
t-inherit="web.ListView"
|
150
185
|
t-inherit-mode="primary"
|
151
|
-
owl="1"
|
152
186
|
>
|
153
187
|
<xpath expr="//t[@list='model.root']" position="attributes">
|
154
188
|
<attribute name="parentRecord">props.parentRecord</attribute>
|
@@ -1,28 +1,34 @@
|
|
1
1
|
from odoo.tests import Form, tagged
|
2
2
|
|
3
|
-
from odoo.addons.
|
3
|
+
from odoo.addons.account_reconcile_model_oca.tests.common import (
|
4
|
+
TestAccountReconciliationCommon,
|
5
|
+
)
|
4
6
|
|
5
7
|
|
6
8
|
@tagged("post_install", "-at_install")
|
7
9
|
class TestReconciliationWidget(TestAccountReconciliationCommon):
|
10
|
+
@classmethod
|
11
|
+
def _setup_context(cls):
|
12
|
+
return {**cls.env.context, "_test_account_reconcile_oca": True}
|
13
|
+
|
8
14
|
@classmethod
|
9
15
|
def setUpClass(cls, chart_template_ref=None):
|
10
16
|
super().setUpClass(chart_template_ref=chart_template_ref)
|
11
|
-
|
17
|
+
cls.env = cls.env(context=cls._setup_context())
|
12
18
|
cls.acc_bank_stmt_model = cls.env["account.bank.statement"]
|
13
19
|
cls.acc_bank_stmt_line_model = cls.env["account.bank.statement.line"]
|
14
20
|
cls.bank_journal_usd.suspense_account_id = (
|
15
|
-
cls.company.account_journal_suspense_account_id
|
21
|
+
cls.env.company.account_journal_suspense_account_id
|
16
22
|
)
|
17
23
|
cls.bank_journal_euro.suspense_account_id = (
|
18
|
-
cls.company.account_journal_suspense_account_id
|
24
|
+
cls.env.company.account_journal_suspense_account_id
|
19
25
|
)
|
20
26
|
cls.current_assets_account = (
|
21
27
|
cls.env["account.account"]
|
22
28
|
.search(
|
23
29
|
[
|
24
30
|
("account_type", "=", "asset_current"),
|
25
|
-
("company_id", "=", cls.company.id),
|
31
|
+
("company_id", "=", cls.env.company.id),
|
26
32
|
],
|
27
33
|
limit=1,
|
28
34
|
)
|
@@ -34,7 +40,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
34
40
|
.search(
|
35
41
|
[
|
36
42
|
("account_type", "=", "asset_receivable"),
|
37
|
-
("company_id", "=", cls.company.id),
|
43
|
+
("company_id", "=", cls.env.company.id),
|
38
44
|
],
|
39
45
|
limit=1,
|
40
46
|
)
|
@@ -46,7 +52,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
46
52
|
.search(
|
47
53
|
[
|
48
54
|
("account_type", "=", "equity"),
|
49
|
-
("company_id", "=", cls.company.id),
|
55
|
+
("company_id", "=", cls.env.company.id),
|
50
56
|
],
|
51
57
|
limit=1,
|
52
58
|
)
|
@@ -57,7 +63,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
57
63
|
.search(
|
58
64
|
[
|
59
65
|
("account_type", "=", "asset_non_current"),
|
60
|
-
("company_id", "=", cls.company.id),
|
66
|
+
("company_id", "=", cls.env.company.id),
|
61
67
|
],
|
62
68
|
limit=1,
|
63
69
|
)
|
@@ -251,7 +257,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
251
257
|
0,
|
252
258
|
{
|
253
259
|
"account_id": self.asset_receivable_account.id,
|
254
|
-
"partner_id": self.company.partner_id.id,
|
260
|
+
"partner_id": self.env.company.partner_id.id,
|
255
261
|
"name": "DEMO",
|
256
262
|
"credit": 100,
|
257
263
|
},
|
@@ -3,27 +3,34 @@ import time
|
|
3
3
|
from odoo.exceptions import UserError
|
4
4
|
from odoo.tests import Form, tagged
|
5
5
|
|
6
|
-
from odoo.addons.
|
6
|
+
from odoo.addons.account_reconcile_model_oca.tests.common import (
|
7
|
+
TestAccountReconciliationCommon,
|
8
|
+
)
|
7
9
|
|
8
10
|
|
9
11
|
@tagged("post_install", "-at_install")
|
10
12
|
class TestReconciliationWidget(TestAccountReconciliationCommon):
|
13
|
+
@classmethod
|
14
|
+
def _setup_context(cls):
|
15
|
+
return {**cls.env.context, "_test_account_reconcile_oca": True}
|
16
|
+
|
11
17
|
@classmethod
|
12
18
|
def setUpClass(cls, chart_template_ref=None):
|
13
19
|
super().setUpClass(chart_template_ref=chart_template_ref)
|
20
|
+
cls.env = cls.env(context=cls._setup_context())
|
14
21
|
|
15
22
|
cls.acc_bank_stmt_model = cls.env["account.bank.statement"]
|
16
23
|
cls.acc_bank_stmt_line_model = cls.env["account.bank.statement.line"]
|
17
24
|
cls.bank_journal_usd.suspense_account_id = (
|
18
|
-
cls.company.account_journal_suspense_account_id
|
25
|
+
cls.env.company.account_journal_suspense_account_id
|
19
26
|
)
|
20
27
|
cls.bank_journal_euro.suspense_account_id = (
|
21
|
-
cls.company.account_journal_suspense_account_id
|
28
|
+
cls.env.company.account_journal_suspense_account_id
|
22
29
|
)
|
23
30
|
cls.current_assets_account = cls.env["account.account"].search(
|
24
31
|
[
|
25
32
|
("account_type", "=", "asset_current"),
|
26
|
-
("company_id", "=", cls.company.id),
|
33
|
+
("company_id", "=", cls.env.company.id),
|
27
34
|
],
|
28
35
|
limit=1,
|
29
36
|
)
|
@@ -98,7 +105,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
98
105
|
) as f:
|
99
106
|
self.assertFalse(f.can_reconcile)
|
100
107
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
101
|
-
lambda
|
108
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
102
109
|
)
|
103
110
|
self.assertFalse(f.add_account_move_line_id)
|
104
111
|
self.assertTrue(f.can_reconcile)
|
@@ -130,7 +137,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
130
137
|
}
|
131
138
|
)
|
132
139
|
receivable1 = inv1.line_ids.filtered(
|
133
|
-
lambda
|
140
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
134
141
|
)
|
135
142
|
with Form(
|
136
143
|
bank_stmt_line,
|
@@ -184,7 +191,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
184
191
|
) as f:
|
185
192
|
self.assertFalse(f.can_reconcile)
|
186
193
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
187
|
-
lambda
|
194
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
188
195
|
)
|
189
196
|
self.assertFalse(f.add_account_move_line_id)
|
190
197
|
self.assertTrue(f.can_reconcile)
|
@@ -238,10 +245,10 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
238
245
|
}
|
239
246
|
)
|
240
247
|
receivable1 = inv1.line_ids.filtered(
|
241
|
-
lambda
|
248
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
242
249
|
)
|
243
250
|
receivable2 = inv2.line_ids.filtered(
|
244
|
-
lambda
|
251
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
245
252
|
)
|
246
253
|
with Form(
|
247
254
|
bank_stmt_line,
|
@@ -298,10 +305,10 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
298
305
|
}
|
299
306
|
)
|
300
307
|
receivable1 = inv1.line_ids.filtered(
|
301
|
-
lambda
|
308
|
+
lambda line: line.account_id.account_type == "liability_payable"
|
302
309
|
)
|
303
310
|
receivable2 = inv2.line_ids.filtered(
|
304
|
-
lambda
|
311
|
+
lambda line: line.account_id.account_type == "liability_payable"
|
305
312
|
)
|
306
313
|
with Form(
|
307
314
|
bank_stmt_line,
|
@@ -419,7 +426,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
419
426
|
inv1 = self.create_invoice(currency_id=self.currency_euro_id)
|
420
427
|
|
421
428
|
receivable1 = inv1.line_ids.filtered(
|
422
|
-
lambda
|
429
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
423
430
|
)
|
424
431
|
bank_stmt = self.acc_bank_stmt_model.create(
|
425
432
|
{
|
@@ -525,7 +532,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
525
532
|
}
|
526
533
|
)
|
527
534
|
receivable1 = inv1.line_ids.filtered(
|
528
|
-
lambda
|
535
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
529
536
|
)
|
530
537
|
with Form(
|
531
538
|
bank_stmt_line,
|
@@ -572,7 +579,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
572
579
|
}
|
573
580
|
)
|
574
581
|
receivable1 = inv1.line_ids.filtered(
|
575
|
-
lambda
|
582
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
576
583
|
)
|
577
584
|
with Form(
|
578
585
|
bank_stmt_line,
|
@@ -649,7 +656,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
649
656
|
}
|
650
657
|
)
|
651
658
|
receivable1 = inv1.line_ids.filtered(
|
652
|
-
lambda
|
659
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
653
660
|
)
|
654
661
|
with Form(
|
655
662
|
bank_stmt_line,
|
@@ -687,7 +694,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
687
694
|
}
|
688
695
|
)
|
689
696
|
receivable1 = inv1.line_ids.filtered(
|
690
|
-
lambda
|
697
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
691
698
|
)
|
692
699
|
with Form(
|
693
700
|
bank_stmt_line,
|
@@ -733,12 +740,12 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
733
740
|
) as f:
|
734
741
|
self.assertFalse(f.can_reconcile)
|
735
742
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
736
|
-
lambda
|
743
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
737
744
|
)
|
738
745
|
self.assertFalse(f.add_account_move_line_id)
|
739
746
|
self.assertTrue(f.can_reconcile)
|
740
747
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
741
|
-
lambda
|
748
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
742
749
|
)
|
743
750
|
self.assertFalse(f.add_account_move_line_id)
|
744
751
|
self.assertFalse(f.can_reconcile)
|
@@ -873,11 +880,11 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
873
880
|
partner = inv1.partner_id
|
874
881
|
|
875
882
|
receivable1 = inv1.line_ids.filtered(
|
876
|
-
lambda
|
883
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
877
884
|
)
|
878
885
|
self.assertTrue(receivable1)
|
879
886
|
receivable2 = inv2.line_ids.filtered(
|
880
|
-
lambda
|
887
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
881
888
|
)
|
882
889
|
self.assertTrue(receivable2)
|
883
890
|
|
@@ -1000,7 +1007,7 @@ class TestReconciliationWidget(TestAccountReconciliationCommon):
|
|
1000
1007
|
) as f:
|
1001
1008
|
self.assertFalse(f.can_reconcile)
|
1002
1009
|
f.add_account_move_line_id = inv1.line_ids.filtered(
|
1003
|
-
lambda
|
1010
|
+
lambda line: line.account_id.account_type == "asset_receivable"
|
1004
1011
|
)
|
1005
1012
|
self.assertFalse(f.add_account_move_line_id)
|
1006
1013
|
self.assertTrue(f.can_reconcile)
|
@@ -8,15 +8,15 @@
|
|
8
8
|
<field name="model">account.account</field>
|
9
9
|
<field name="inherit_id" ref="account.view_account_list" />
|
10
10
|
<field name="arch" type="xml">
|
11
|
-
<
|
11
|
+
<tree position="inside">
|
12
12
|
<button
|
13
13
|
type="action"
|
14
14
|
name="%(account_reconcile_oca.account_account_account_account_reconcile_act_window)s"
|
15
15
|
string="Reconcile"
|
16
16
|
class="float-end btn-secondary"
|
17
|
-
|
17
|
+
invisible="reconcile == False"
|
18
18
|
/>
|
19
|
-
</
|
19
|
+
</tree>
|
20
20
|
</field>
|
21
21
|
</record>
|
22
22
|
|
@@ -21,15 +21,15 @@
|
|
21
21
|
name="reconcile"
|
22
22
|
type="object"
|
23
23
|
string="Reconcile"
|
24
|
-
class="btn btn-primary"
|
25
|
-
|
24
|
+
class="btn btn-primary mx-1"
|
25
|
+
invisible="is_reconciled == True"
|
26
26
|
/>
|
27
27
|
<button
|
28
28
|
name="clean_reconcile"
|
29
29
|
type="object"
|
30
30
|
string="Clean"
|
31
|
-
class="btn btn-secondary"
|
32
|
-
|
31
|
+
class="btn btn-secondary mx-1"
|
32
|
+
invisible="is_reconciled == True"
|
33
33
|
/>
|
34
34
|
</div>
|
35
35
|
</div>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
<page
|
53
53
|
name="reconcile_line"
|
54
54
|
string="Reconcile"
|
55
|
-
|
55
|
+
invisible="is_reconciled == True"
|
56
56
|
>
|
57
57
|
<field
|
58
58
|
name="add_account_move_line_id"
|
@@ -135,7 +135,7 @@
|
|
135
135
|
<field name="name">Reconcile</field>
|
136
136
|
<field name="res_model">account.account.reconcile</field>
|
137
137
|
<field name="view_mode">kanban</field>
|
138
|
-
<field name="domain">[("partner_id", "=",
|
138
|
+
<field name="domain">[("partner_id", "=", id)]</field>
|
139
139
|
<field
|
140
140
|
name="context"
|
141
141
|
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
@@ -150,7 +150,7 @@
|
|
150
150
|
<field name="name">Reconcile</field>
|
151
151
|
<field name="res_model">account.account.reconcile</field>
|
152
152
|
<field name="view_mode">kanban</field>
|
153
|
-
<field name="domain">[("account_id", "=",
|
153
|
+
<field name="domain">[("account_id", "=", id)]</field>
|
154
154
|
<field
|
155
155
|
name="context"
|
156
156
|
>{'view_ref': 'account_reconcile_oca.account_account_reconcile_form_view'}</field>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
2
|
+
<!-- Copyright 2023 Dixmit
|
3
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
4
|
+
<odoo>
|
5
|
+
|
6
|
+
<record id="account_bank_statement_form_edit" model="ir.ui.view">
|
7
|
+
<field name="name">Edit Bank statement</field>
|
8
|
+
<field name="model">account.bank.statement</field>
|
9
|
+
<field name="priority">99</field>
|
10
|
+
<field name="arch" type="xml">
|
11
|
+
<form string="Bank Statement">
|
12
|
+
<div
|
13
|
+
class="alert alert-warning text-center"
|
14
|
+
role="alert"
|
15
|
+
invisible="is_valid and is_complete"
|
16
|
+
>
|
17
|
+
<field name="problem_description" />
|
18
|
+
<field name="is_valid" invisible="1" />
|
19
|
+
<field name="is_complete" invisible="1" />
|
20
|
+
</div>
|
21
|
+
<sheet>
|
22
|
+
<group>
|
23
|
+
<field name="name" required="1" />
|
24
|
+
<field name="balance_start" />
|
25
|
+
<field name="balance_end_real" />
|
26
|
+
<field name="attachment_ids" widget="many2many_binary" />
|
27
|
+
<field name="line_ids" invisible="1" />
|
28
|
+
</group>
|
29
|
+
</sheet>
|
30
|
+
|
31
|
+
</form>
|
32
|
+
</field>
|
33
|
+
</record>
|
34
|
+
|
35
|
+
<record id="account_bank_statement_action_edit" model="ir.actions.act_window">
|
36
|
+
<field name="name">Edit Bank Statement</field>
|
37
|
+
<field name="res_model">account.bank.statement</field>
|
38
|
+
<field name="view_mode">form</field>
|
39
|
+
<field
|
40
|
+
name="view_ids"
|
41
|
+
eval="[(5, 0, 0),
|
42
|
+
(0, 0, {'view_mode': 'form', 'view_id': ref('account_bank_statement_form_edit')})]"
|
43
|
+
/>
|
44
|
+
<field name="target">new</field>
|
45
|
+
</record>
|
46
|
+
</odoo>
|