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
@@ -3,7 +3,10 @@
|
|
3
3
|
|
4
4
|
from collections import defaultdict
|
5
5
|
|
6
|
-
from
|
6
|
+
from dateutil import rrule
|
7
|
+
from dateutil.relativedelta import relativedelta
|
8
|
+
|
9
|
+
from odoo import Command, _, api, fields, models, tools
|
7
10
|
from odoo.exceptions import UserError
|
8
11
|
from odoo.tools import float_is_zero
|
9
12
|
|
@@ -86,6 +89,43 @@ class AccountBankStatementLine(models.Model):
|
|
86
89
|
"account.move", default=False, store=False, prefetch=False, readonly=True
|
87
90
|
)
|
88
91
|
can_reconcile = fields.Boolean(sparse="reconcile_data_info")
|
92
|
+
reconcile_aggregate = fields.Char(compute="_compute_reconcile_aggregate")
|
93
|
+
aggregate_id = fields.Integer(compute="_compute_reconcile_aggregate")
|
94
|
+
aggregate_name = fields.Char(compute="_compute_reconcile_aggregate")
|
95
|
+
|
96
|
+
@api.model
|
97
|
+
def _reconcile_aggregate_map(self):
|
98
|
+
lang = self.env["res.lang"]._lang_get(self.env.user.lang)
|
99
|
+
week_start = rrule.weekday(int(lang.week_start) - 1)
|
100
|
+
return {
|
101
|
+
False: lambda s: (False, False),
|
102
|
+
"statement": lambda s: (s.statement_id.id, s.statement_id.name),
|
103
|
+
"day": lambda s: (s.date.toordinal(), s.date.strftime(lang.date_format)),
|
104
|
+
"week": lambda s: (
|
105
|
+
(s.date + relativedelta(weekday=week_start(-1))).toordinal(),
|
106
|
+
(s.date + relativedelta(weekday=week_start(-1))).strftime(
|
107
|
+
lang.date_format
|
108
|
+
),
|
109
|
+
),
|
110
|
+
"month": lambda s: (
|
111
|
+
s.date.replace(day=1).toordinal(),
|
112
|
+
s.date.replace(day=1).strftime(lang.date_format),
|
113
|
+
),
|
114
|
+
}
|
115
|
+
|
116
|
+
@api.depends("company_id", "journal_id")
|
117
|
+
def _compute_reconcile_aggregate(self):
|
118
|
+
reconcile_aggregate_map = self._reconcile_aggregate_map()
|
119
|
+
for record in self:
|
120
|
+
reconcile_aggregate = (
|
121
|
+
record.journal_id.reconcile_aggregate
|
122
|
+
or record.company_id.reconcile_aggregate
|
123
|
+
)
|
124
|
+
record.reconcile_aggregate = reconcile_aggregate
|
125
|
+
print(record.date, reconcile_aggregate_map[reconcile_aggregate](record))
|
126
|
+
record.aggregate_id, record.aggregate_name = reconcile_aggregate_map[
|
127
|
+
reconcile_aggregate
|
128
|
+
](record)
|
89
129
|
|
90
130
|
def save(self):
|
91
131
|
return {"type": "ir.actions.act_window_close"}
|
@@ -111,7 +151,7 @@ class AccountBankStatementLine(models.Model):
|
|
111
151
|
self.manual_model_id,
|
112
152
|
self.reconcile_data_info["reconcile_auxiliary_id"],
|
113
153
|
),
|
114
|
-
self.manual_reference
|
154
|
+
self.manual_reference,
|
115
155
|
)
|
116
156
|
else:
|
117
157
|
# Refreshing data
|
@@ -191,10 +231,14 @@ class AccountBankStatementLine(models.Model):
|
|
191
231
|
suspense_line = {
|
192
232
|
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
193
233
|
"id": False,
|
194
|
-
"account_id":
|
234
|
+
"account_id": [
|
235
|
+
self.journal_id.suspense_account_id.id,
|
236
|
+
self.journal_id.suspense_account_id.display_name,
|
237
|
+
],
|
195
238
|
"partner_id": self.partner_id
|
196
|
-
and self.partner_id.
|
197
|
-
or (False, self.partner_name)
|
239
|
+
and [self.partner_id.id, self.partner_id.display_name]
|
240
|
+
or (self.partner_name and (False, self.partner_name))
|
241
|
+
or False,
|
198
242
|
"date": fields.Date.to_string(self.date),
|
199
243
|
"name": self.payment_ref or self.name,
|
200
244
|
"amount": -total_amount,
|
@@ -223,9 +267,7 @@ class AccountBankStatementLine(models.Model):
|
|
223
267
|
)
|
224
268
|
or self.manual_account_id.id != line["account_id"][0]
|
225
269
|
or self.manual_name != line["name"]
|
226
|
-
or (
|
227
|
-
self.manual_partner_id and self.manual_partner_id.name_get()[0] or False
|
228
|
-
)
|
270
|
+
or (self.manual_partner_id and self.manual_partner_id.display_name or False)
|
229
271
|
!= line.get("partner_id")
|
230
272
|
)
|
231
273
|
|
@@ -296,9 +338,16 @@ class AccountBankStatementLine(models.Model):
|
|
296
338
|
{
|
297
339
|
"name": self.manual_name,
|
298
340
|
"partner_id": self.manual_partner_id
|
299
|
-
and
|
300
|
-
|
301
|
-
|
341
|
+
and [
|
342
|
+
self.manual_partner_id.id,
|
343
|
+
self.manual_partner_id.display_name,
|
344
|
+
]
|
345
|
+
or (self.partner_name and (False, self.partner_name))
|
346
|
+
or False,
|
347
|
+
"account_id": [
|
348
|
+
self.manual_account_id.id,
|
349
|
+
self.manual_account_id.display_name,
|
350
|
+
]
|
302
351
|
if self.manual_account_id
|
303
352
|
else [False, _("Undefined")],
|
304
353
|
"amount": self.manual_amount,
|
@@ -381,9 +430,12 @@ class AccountBankStatementLine(models.Model):
|
|
381
430
|
"debit": amount if amount > 0 else 0,
|
382
431
|
"credit": -amount if amount < 0 else 0,
|
383
432
|
"kind": "other",
|
384
|
-
"account_id":
|
385
|
-
|
386
|
-
|
433
|
+
"account_id": [
|
434
|
+
line["account_id"],
|
435
|
+
self.env["account.account"]
|
436
|
+
.browse(line["account_id"])
|
437
|
+
.display_name,
|
438
|
+
],
|
387
439
|
"date": fields.Date.to_string(self.date),
|
388
440
|
"line_currency_id": self.company_id.currency_id.id,
|
389
441
|
"currency_id": self.company_id.currency_id.id,
|
@@ -393,7 +445,8 @@ class AccountBankStatementLine(models.Model):
|
|
393
445
|
reconcile_auxiliary_id += 1
|
394
446
|
if line.get("partner_id"):
|
395
447
|
new_line["partner_id"] = (
|
396
|
-
|
448
|
+
line["partner_id"],
|
449
|
+
self.env["res.partner"].browse(line["partner_id"]).display_name,
|
397
450
|
)
|
398
451
|
new_data.append(new_line)
|
399
452
|
return new_data, reconcile_auxiliary_id
|
@@ -420,7 +473,7 @@ class AccountBankStatementLine(models.Model):
|
|
420
473
|
{
|
421
474
|
"reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
|
422
475
|
"id": False,
|
423
|
-
"account_id": account.
|
476
|
+
"account_id": [account.id, account.display_name],
|
424
477
|
"partner_id": False,
|
425
478
|
"date": fields.Date.to_string(self.date),
|
426
479
|
"name": self.payment_ref or self.name,
|
@@ -455,7 +508,7 @@ class AccountBankStatementLine(models.Model):
|
|
455
508
|
data, res["model"], reconcile_auxiliary_id
|
456
509
|
),
|
457
510
|
self.manual_reference,
|
458
|
-
exchange_recompute=True
|
511
|
+
exchange_recompute=True,
|
459
512
|
)
|
460
513
|
elif res and res.get("amls"):
|
461
514
|
amount = self.amount_total_signed
|
@@ -636,6 +689,10 @@ class AccountBankStatementLine(models.Model):
|
|
636
689
|
@api.model_create_multi
|
637
690
|
def create(self, mvals):
|
638
691
|
result = super().create(mvals)
|
692
|
+
if tools.config["test_enable"] and not self.env.context.get(
|
693
|
+
"_test_account_reconcile_oca"
|
694
|
+
):
|
695
|
+
return result
|
639
696
|
models = self.env["account.reconcile.model"].search(
|
640
697
|
[
|
641
698
|
("rule_type", "in", ["invoice_matching", "writeoff_suggestion"]),
|
@@ -658,7 +715,7 @@ class AccountBankStatementLine(models.Model):
|
|
658
715
|
data, res["model"], reconcile_auxiliary_id
|
659
716
|
),
|
660
717
|
self.manual_reference,
|
661
|
-
exchange_recompute=True
|
718
|
+
exchange_recompute=True,
|
662
719
|
)
|
663
720
|
elif res.get("amls"):
|
664
721
|
amount = self.amount
|
@@ -749,6 +806,28 @@ class AccountBankStatementLine(models.Model):
|
|
749
806
|
max_amount=max_amount,
|
750
807
|
from_unreconcile=from_unreconcile,
|
751
808
|
)
|
752
|
-
if vals["partner_id"] is False:
|
809
|
+
if vals["partner_id"] is False and self.partner_name:
|
753
810
|
vals["partner_id"] = (False, self.partner_name)
|
754
811
|
return vals
|
812
|
+
|
813
|
+
def add_statement(self):
|
814
|
+
self.ensure_one()
|
815
|
+
action = self.env["ir.actions.act_window"]._for_xml_id(
|
816
|
+
"account_reconcile_oca.account_bank_statement_action_edit"
|
817
|
+
)
|
818
|
+
previous_line_with_statement = self.env["account.bank.statement.line"].search(
|
819
|
+
[
|
820
|
+
("internal_index", "<", self.internal_index),
|
821
|
+
("journal_id", "=", self.journal_id.id),
|
822
|
+
("state", "=", "posted"),
|
823
|
+
("statement_id", "!=", self.statement_id.id),
|
824
|
+
("statement_id", "!=", False),
|
825
|
+
],
|
826
|
+
limit=1,
|
827
|
+
)
|
828
|
+
action["context"] = {
|
829
|
+
"default_journal_id": self.journal_id.id,
|
830
|
+
"default_balance_start": previous_line_with_statement.statement_id.balance_end_real,
|
831
|
+
"split_line_id": self.id,
|
832
|
+
}
|
833
|
+
return action
|
@@ -12,9 +12,23 @@ class AccountJournal(models.Model):
|
|
12
12
|
default="edit",
|
13
13
|
required=True,
|
14
14
|
)
|
15
|
+
company_currency_id = fields.Many2one(related="company_id.currency_id")
|
16
|
+
reconcile_aggregate = fields.Selection(
|
17
|
+
[
|
18
|
+
("statement", "Statement"),
|
19
|
+
("day", "Day"),
|
20
|
+
("week", "Week"),
|
21
|
+
("month", "Month"),
|
22
|
+
],
|
23
|
+
string="Reconcile aggregation",
|
24
|
+
help="Aggregation to use on reconcile view",
|
25
|
+
)
|
15
26
|
|
16
27
|
def get_rainbowman_message(self):
|
17
28
|
self.ensure_one()
|
18
|
-
if
|
29
|
+
if (
|
30
|
+
self._get_journal_dashboard_data_batched()[self.id]["number_to_reconcile"]
|
31
|
+
> 0
|
32
|
+
):
|
19
33
|
return False
|
20
34
|
return _("Well done! Everything has been reconciled")
|
@@ -68,8 +68,10 @@ class AccountReconcileAbstract(models.AbstractModel):
|
|
68
68
|
vals = {
|
69
69
|
"reference": "account.move.line;%s" % line.id,
|
70
70
|
"id": line.id,
|
71
|
-
"account_id": line.account_id.
|
72
|
-
"partner_id": line.partner_id
|
71
|
+
"account_id": [line.account_id.id, line.account_id.display_name],
|
72
|
+
"partner_id": [line.partner_id.id, line.partner_id.display_name]
|
73
|
+
if line.partner_id
|
74
|
+
else False,
|
73
75
|
"date": fields.Date.to_string(line.date),
|
74
76
|
"name": line.name,
|
75
77
|
"debit": amount if amount > 0 else 0.0,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Copyright 2024 Dixmit
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class ResCompany(models.Model):
|
8
|
+
_inherit = "res.company"
|
9
|
+
|
10
|
+
reconcile_aggregate = fields.Selection(
|
11
|
+
selection=lambda self: self.env["account.journal"]
|
12
|
+
._fields["reconcile_aggregate"]
|
13
|
+
.selection
|
14
|
+
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Copyright 2024 Dixmit
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
3
|
+
|
4
|
+
from odoo import fields, models
|
5
|
+
|
6
|
+
|
7
|
+
class ResConfigSettings(models.TransientModel):
|
8
|
+
_inherit = "res.config.settings"
|
9
|
+
|
10
|
+
reconcile_aggregate = fields.Selection(
|
11
|
+
related="company_id.reconcile_aggregate", readonly=False
|
12
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
- Enric Tobella
|
@@ -1 +1,2 @@
|
|
1
|
-
This addon allows to reconcile bank statements and account marked as
|
1
|
+
This addon allows to reconcile bank statements and account marked as
|
2
|
+
reconcile.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
## Bank reconcile
|
2
|
+
|
3
|
+
Access Invoicing / Dashboard with a user with Full Acounting
|
4
|
+
capabilities. Select reconcile on the journal of your choice.
|
5
|
+
|
6
|
+
## Account reconcile
|
7
|
+
|
8
|
+
Access Invoicing / Accounting / Actions / Reconcile All the possible
|
9
|
+
reconcile options will show and you will be able to reconcile properly.
|
10
|
+
You can access the same widget from accounts and Partners.
|
@@ -366,10 +366,11 @@ ul.auto-toc {
|
|
366
366
|
!! This file is generated by oca-gen-addon-readme !!
|
367
367
|
!! changes will be overwritten. !!
|
368
368
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
369
|
-
!! source digest: sha256:
|
369
|
+
!! source digest: sha256:eaa1b6b3dece89dbb5fd23794f5d597769b2e3cc3823ffb127b4dd7808251d19
|
370
370
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
371
|
-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/
|
372
|
-
<p>This addon allows to reconcile bank statements and account marked as
|
371
|
+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/17.0/account_reconcile_oca"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-reconcile-17-0/account-reconcile-17-0-account_reconcile_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
372
|
+
<p>This addon allows to reconcile bank statements and account marked as
|
373
|
+
reconcile.</p>
|
373
374
|
<p><strong>Table of contents</strong></p>
|
374
375
|
<div class="contents local topic" id="contents">
|
375
376
|
<ul class="simple">
|
@@ -392,13 +393,13 @@ ul.auto-toc {
|
|
392
393
|
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
393
394
|
<div class="section" id="bank-reconcile">
|
394
395
|
<h2><a class="toc-backref" href="#toc-entry-2">Bank reconcile</a></h2>
|
395
|
-
<p>Access
|
396
|
-
Select reconcile on the journal of your choice.</p>
|
396
|
+
<p>Access Invoicing / Dashboard with a user with Full Acounting
|
397
|
+
capabilities. Select reconcile on the journal of your choice.</p>
|
397
398
|
</div>
|
398
399
|
<div class="section" id="account-reconcile">
|
399
400
|
<h2><a class="toc-backref" href="#toc-entry-3">Account reconcile</a></h2>
|
400
|
-
<p>Access
|
401
|
-
|
401
|
+
<p>Access Invoicing / Accounting / Actions / Reconcile All the possible
|
402
|
+
reconcile options will show and you will be able to reconcile properly.
|
402
403
|
You can access the same widget from accounts and Partners.</p>
|
403
404
|
</div>
|
404
405
|
</div>
|
@@ -414,7 +415,7 @@ You can access the same widget from accounts and Partners.</p>
|
|
414
415
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-reconcile/issues">GitHub Issues</a>.
|
415
416
|
In case of trouble, please check there if your issue has already been reported.
|
416
417
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
417
|
-
<a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_reconcile_oca%0Aversion:%
|
418
|
+
<a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_reconcile_oca%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
418
419
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
419
420
|
</div>
|
420
421
|
<div class="section" id="credits">
|
@@ -441,7 +442,7 @@ mission is to support the collaborative development of Odoo features and
|
|
441
442
|
promote its widespread use.</p>
|
442
443
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
443
444
|
<p><a class="reference external image-reference" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
|
444
|
-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/
|
445
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/17.0/account_reconcile_oca">OCA/account-reconcile</a> project on GitHub.</p>
|
445
446
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
446
447
|
</div>
|
447
448
|
</div>
|
@@ -1,14 +1,17 @@
|
|
1
1
|
/** @odoo-module */
|
2
|
-
const {useState, useSubEnv} = owl;
|
2
|
+
const {onMounted, onWillStart, useState, useSubEnv} = owl;
|
3
|
+
import {useBus, useService} from "@web/core/utils/hooks";
|
3
4
|
import {KanbanController} from "@web/views/kanban/kanban_controller";
|
4
5
|
import {View} from "@web/views/view";
|
5
|
-
import {
|
6
|
+
import {formatMonetary} from "@web/views/fields/formatters";
|
6
7
|
|
7
8
|
export class ReconcileController extends KanbanController {
|
8
9
|
async setup() {
|
9
10
|
super.setup();
|
10
11
|
this.state = useState({
|
11
12
|
selectedRecordId: null,
|
13
|
+
journalBalance: 0,
|
14
|
+
currency: false,
|
12
15
|
});
|
13
16
|
useSubEnv({
|
14
17
|
parentController: this,
|
@@ -19,7 +22,42 @@ export class ReconcileController extends KanbanController {
|
|
19
22
|
this.action = useService("action");
|
20
23
|
this.router = useService("router");
|
21
24
|
this.activeActions = this.props.archInfo.activeActions;
|
22
|
-
this.model.
|
25
|
+
useBus(this.model.bus, "update", () => {
|
26
|
+
this.selectRecord();
|
27
|
+
});
|
28
|
+
onWillStart(() => {
|
29
|
+
this.updateJournalInfo();
|
30
|
+
});
|
31
|
+
onMounted(() => {
|
32
|
+
this.selectRecord();
|
33
|
+
});
|
34
|
+
}
|
35
|
+
get journalId() {
|
36
|
+
if (this.props.resModel === "account.bank.statement.line") {
|
37
|
+
return this.props.context.active_id;
|
38
|
+
}
|
39
|
+
return false;
|
40
|
+
}
|
41
|
+
async updateJournalInfo() {
|
42
|
+
var journalId = this.journalId;
|
43
|
+
if (!journalId) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
var result = await this.orm.call("account.journal", "read", [
|
47
|
+
[journalId],
|
48
|
+
["current_statement_balance", "currency_id", "company_currency_id"],
|
49
|
+
]);
|
50
|
+
this.state.journalBalance = result[0].current_statement_balance;
|
51
|
+
this.state.currency = (result[0].currency_id ||
|
52
|
+
result[0].company_currency_id)[0];
|
53
|
+
}
|
54
|
+
get journalBalanceStr() {
|
55
|
+
if (!this.state.journalBalance) {
|
56
|
+
return "";
|
57
|
+
}
|
58
|
+
return formatMonetary(this.state.journalBalance, {
|
59
|
+
currencyId: this.state.currency,
|
60
|
+
});
|
23
61
|
}
|
24
62
|
exposeController(controller) {
|
25
63
|
this.form_controller = controller;
|
@@ -45,6 +83,7 @@ export class ReconcileController extends KanbanController {
|
|
45
83
|
return {
|
46
84
|
resId: this.state.selectedRecordId,
|
47
85
|
type: "form",
|
86
|
+
noBreadcrumbs: true,
|
48
87
|
context: {
|
49
88
|
...(this.props.context || {}),
|
50
89
|
form_view_ref: this.props.context.view_ref,
|
@@ -55,7 +94,7 @@ export class ReconcileController extends KanbanController {
|
|
55
94
|
};
|
56
95
|
}
|
57
96
|
async selectRecord(record) {
|
58
|
-
var resId =
|
97
|
+
var resId = false;
|
59
98
|
if (record === undefined && this.props.resId) {
|
60
99
|
resId = this.props.resId;
|
61
100
|
} else if (record === undefined) {
|
@@ -97,6 +136,7 @@ export class ReconcileController extends KanbanController {
|
|
97
136
|
this.router.pushState({id: resId});
|
98
137
|
}
|
99
138
|
}
|
139
|
+
|
100
140
|
ReconcileController.components = {
|
101
141
|
...ReconcileController.components,
|
102
142
|
View,
|
@@ -2,7 +2,58 @@
|
|
2
2
|
|
3
3
|
import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
|
4
4
|
import {ReconcileKanbanRecord} from "./reconcile_kanban_record.esm.js";
|
5
|
-
|
5
|
+
import {formatMonetary} from "@web/views/fields/formatters";
|
6
|
+
import {useService} from "@web/core/utils/hooks";
|
7
|
+
|
8
|
+
export class ReconcileRenderer extends KanbanRenderer {
|
9
|
+
setup() {
|
10
|
+
super.setup();
|
11
|
+
this.action = useService("action");
|
12
|
+
this.orm = useService("orm");
|
13
|
+
}
|
14
|
+
getAggregates() {
|
15
|
+
if (
|
16
|
+
this.env.parentController.props.resModel !== "account.bank.statement.line"
|
17
|
+
) {
|
18
|
+
return [];
|
19
|
+
}
|
20
|
+
const {list} = this.props;
|
21
|
+
const aggregates = [];
|
22
|
+
for (const record of list.records) {
|
23
|
+
const aggregateId = record.data.aggregate_id && record.data.aggregate_id;
|
24
|
+
if (
|
25
|
+
aggregateId &&
|
26
|
+
(!aggregates.length || aggregates[0].id !== aggregateId)
|
27
|
+
) {
|
28
|
+
aggregates.push({
|
29
|
+
id: aggregateId,
|
30
|
+
name: record.data.aggregate_name,
|
31
|
+
balance: record.data.statement_balance_end_real,
|
32
|
+
balanceStr: formatMonetary(record.data.statement_balance_end_real, {
|
33
|
+
currencyId: record.data.currency_id[0],
|
34
|
+
}),
|
35
|
+
});
|
36
|
+
}
|
37
|
+
}
|
38
|
+
return aggregates;
|
39
|
+
}
|
40
|
+
async onClickStatement(statementId) {
|
41
|
+
const action = await this.orm.call(
|
42
|
+
"account.bank.statement",
|
43
|
+
"action_open_statement",
|
44
|
+
[[statementId]],
|
45
|
+
{
|
46
|
+
context: this.props.context,
|
47
|
+
}
|
48
|
+
);
|
49
|
+
const model = this.props.list.model;
|
50
|
+
this.action.doAction(action, {
|
51
|
+
async onClose() {
|
52
|
+
model.root.load();
|
53
|
+
},
|
54
|
+
});
|
55
|
+
}
|
56
|
+
}
|
6
57
|
|
7
58
|
ReconcileRenderer.components = {
|
8
59
|
...KanbanRenderer.components,
|
odoo/addons/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js
CHANGED
@@ -17,6 +17,9 @@ export class ReconcileFormController extends FormController {
|
|
17
17
|
afterExecuteAction: this.afterExecuteActionButton.bind(this),
|
18
18
|
});
|
19
19
|
}
|
20
|
+
displayName() {
|
21
|
+
return this.env.config.getDisplayName();
|
22
|
+
}
|
20
23
|
async reloadFormController() {
|
21
24
|
var is_reconciled = this.model.root.data.is_reconciled;
|
22
25
|
await this.model.root.load();
|
odoo/addons/account_reconcile_oca/static/src/js/reconcile_manual/reconcile_manual_controller.esm.js
CHANGED
@@ -15,6 +15,9 @@ export class ReconcileManualController extends FormController {
|
|
15
15
|
afterExecuteAction: this.afterExecuteActionButton.bind(this),
|
16
16
|
});
|
17
17
|
}
|
18
|
+
displayName() {
|
19
|
+
return this.env.config.getDisplayName();
|
20
|
+
}
|
18
21
|
async reloadFormController() {
|
19
22
|
try {
|
20
23
|
await this.model.root.load();
|
@@ -10,7 +10,7 @@ export class ReconcileMoveLineRenderer extends ListRenderer {
|
|
10
10
|
record.resId
|
11
11
|
)
|
12
12
|
) {
|
13
|
-
classes += " o_field_account_reconcile_oca_move_line_selected";
|
13
|
+
classes += " o_field_account_reconcile_oca_move_line_selected table-info";
|
14
14
|
}
|
15
15
|
return classes;
|
16
16
|
}
|
@@ -1,15 +1,22 @@
|
|
1
1
|
/** @odoo-module **/
|
2
2
|
|
3
|
-
import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
|
3
|
+
// import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
|
4
|
+
// import {Chatter} from "@mail/core/web/chatter";
|
4
5
|
import {registry} from "@web/core/registry";
|
6
|
+
import {standardFieldProps} from "@web/views/fields/standard_field_props";
|
7
|
+
import {Chatter} from "@mail/core/web/chatter";
|
5
8
|
|
6
9
|
const {Component} = owl;
|
7
10
|
|
8
11
|
export class AccountReconcileChatterWidget extends Component {}
|
12
|
+
AccountReconcileChatterWidget.props = {...standardFieldProps};
|
9
13
|
AccountReconcileChatterWidget.template =
|
10
14
|
"account_reconcile_oca.AccountReconcileChatterWidget";
|
11
|
-
AccountReconcileChatterWidget.components = {...Component.components,
|
12
|
-
|
15
|
+
AccountReconcileChatterWidget.components = {...Component.components, Chatter};
|
16
|
+
export const AccountReconcileChatterWidgetField = {
|
17
|
+
component: AccountReconcileChatterWidget,
|
18
|
+
supportedTypes: [],
|
19
|
+
};
|
13
20
|
registry
|
14
21
|
.category("fields")
|
15
|
-
.add("account_reconcile_oca_chatter",
|
22
|
+
.add("account_reconcile_oca_chatter", AccountReconcileChatterWidgetField);
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/** @odoo-module **/
|
2
|
-
|
3
|
-
import
|
2
|
+
import {formatDate, parseDate} from "@web/core/l10n/dates";
|
3
|
+
import {formatMonetary} from "@web/views/fields/formatters";
|
4
4
|
import {registry} from "@web/core/registry";
|
5
|
-
import session from "web.session";
|
6
5
|
|
7
6
|
const {Component} = owl;
|
8
7
|
|
@@ -22,45 +21,31 @@ export class AccountReconcileDataWidget extends Component {
|
|
22
21
|
getReconcileLines() {
|
23
22
|
var data = this.props.record.data[this.props.name].data;
|
24
23
|
for (var line in data) {
|
25
|
-
data[line].amount_format =
|
26
|
-
data[line].
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
{
|
36
|
-
currency: session.get_currency(data[line].currency_id),
|
37
|
-
}
|
38
|
-
);
|
39
|
-
data[line].credit_format = fieldUtils.format.monetary(
|
40
|
-
data[line].credit,
|
41
|
-
undefined,
|
42
|
-
{
|
43
|
-
currency: session.get_currency(data[line].currency_id),
|
44
|
-
}
|
45
|
-
);
|
46
|
-
data[line].amount_currency_format = fieldUtils.format.monetary(
|
24
|
+
data[line].amount_format = formatMonetary(data[line].amount, {
|
25
|
+
currencyId: data[line].currency_id,
|
26
|
+
});
|
27
|
+
data[line].debit_format = formatMonetary(data[line].debit, {
|
28
|
+
currencyId: data[line].currency_id,
|
29
|
+
});
|
30
|
+
data[line].credit_format = formatMonetary(data[line].credit, {
|
31
|
+
currencyId: data[line].currency_id,
|
32
|
+
});
|
33
|
+
data[line].amount_currency_format = formatMonetary(
|
47
34
|
data[line].currency_amount,
|
48
|
-
undefined,
|
49
35
|
{
|
50
|
-
|
36
|
+
currencyId: data[line].line_currency_id,
|
51
37
|
}
|
52
38
|
);
|
53
39
|
if (data[line].original_amount) {
|
54
|
-
data[line].original_amount_format =
|
40
|
+
data[line].original_amount_format = formatMonetary(
|
55
41
|
data[line].original_amount,
|
56
|
-
undefined,
|
57
42
|
{
|
58
|
-
|
43
|
+
currencyId: data[line].currency_id,
|
59
44
|
}
|
60
45
|
);
|
61
46
|
}
|
62
|
-
data[line].date_format =
|
63
|
-
|
47
|
+
data[line].date_format = formatDate(
|
48
|
+
parseDate(data[line].date, undefined, {isUTC: true})
|
64
49
|
);
|
65
50
|
}
|
66
51
|
return data;
|
@@ -86,6 +71,10 @@ export class AccountReconcileDataWidget extends Component {
|
|
86
71
|
}
|
87
72
|
AccountReconcileDataWidget.template = "account_reconcile_oca.ReconcileDataWidget";
|
88
73
|
|
74
|
+
export const AccountReconcileDataWidgetField = {
|
75
|
+
component: AccountReconcileDataWidget,
|
76
|
+
supportedTypes: [],
|
77
|
+
};
|
89
78
|
registry
|
90
79
|
.category("fields")
|
91
|
-
.add("account_reconcile_oca_data",
|
80
|
+
.add("account_reconcile_oca_data", AccountReconcileDataWidgetField);
|