odoo-addon-account-reconcile-oca 16.0.1.2.13.1__py3-none-any.whl → 16.0.1.2.14.1__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.
Files changed (33) hide show
  1. odoo/addons/account_reconcile_oca/README.rst +1 -1
  2. odoo/addons/account_reconcile_oca/__manifest__.py +3 -1
  3. odoo/addons/account_reconcile_oca/i18n/account_reconcile_oca.pot +108 -1
  4. odoo/addons/account_reconcile_oca/i18n/ca.po +108 -1
  5. odoo/addons/account_reconcile_oca/i18n/es.po +108 -1
  6. odoo/addons/account_reconcile_oca/i18n/fr.po +108 -1
  7. odoo/addons/account_reconcile_oca/i18n/hr.po +108 -1
  8. odoo/addons/account_reconcile_oca/i18n/it.po +108 -1
  9. odoo/addons/account_reconcile_oca/i18n/nl.po +108 -1
  10. odoo/addons/account_reconcile_oca/i18n/pt_BR.po +108 -1
  11. odoo/addons/account_reconcile_oca/i18n/sv.po +108 -1
  12. odoo/addons/account_reconcile_oca/i18n/tr.po +108 -1
  13. odoo/addons/account_reconcile_oca/models/__init__.py +3 -0
  14. odoo/addons/account_reconcile_oca/models/account_bank_statement.py +15 -0
  15. odoo/addons/account_reconcile_oca/models/account_bank_statement_line.py +74 -0
  16. odoo/addons/account_reconcile_oca/models/account_journal.py +11 -0
  17. odoo/addons/account_reconcile_oca/models/res_company.py +14 -0
  18. odoo/addons/account_reconcile_oca/models/res_config_settings.py +12 -0
  19. odoo/addons/account_reconcile_oca/static/description/index.html +1 -1
  20. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +38 -1
  21. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_renderer.esm.js +53 -1
  22. odoo/addons/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +3 -0
  23. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +0 -2
  24. odoo/addons/account_reconcile_oca/static/src/scss/reconcile.scss +16 -0
  25. odoo/addons/account_reconcile_oca/static/src/xml/reconcile.xml +37 -0
  26. odoo/addons/account_reconcile_oca/views/account_bank_statement.xml +46 -0
  27. odoo/addons/account_reconcile_oca/views/account_bank_statement_line.xml +20 -1
  28. odoo/addons/account_reconcile_oca/views/account_journal.xml +5 -0
  29. odoo/addons/account_reconcile_oca/views/res_config_settings.xml +38 -0
  30. {odoo_addon_account_reconcile_oca-16.0.1.2.13.1.dist-info → odoo_addon_account_reconcile_oca-16.0.1.2.14.1.dist-info}/METADATA +2 -2
  31. {odoo_addon_account_reconcile_oca-16.0.1.2.13.1.dist-info → odoo_addon_account_reconcile_oca-16.0.1.2.14.1.dist-info}/RECORD +33 -28
  32. {odoo_addon_account_reconcile_oca-16.0.1.2.13.1.dist-info → odoo_addon_account_reconcile_oca-16.0.1.2.14.1.dist-info}/WHEEL +0 -0
  33. {odoo_addon_account_reconcile_oca-16.0.1.2.13.1.dist-info → odoo_addon_account_reconcile_oca-16.0.1.2.14.1.dist-info}/top_level.txt +0 -0
@@ -55,6 +55,21 @@ msgstr ""
55
55
  msgid "Add Bank Statement Line"
56
56
  msgstr ""
57
57
 
58
+ #. module: account_reconcile_oca
59
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__aggregate_id
60
+ msgid "Aggregate"
61
+ msgstr ""
62
+
63
+ #. module: account_reconcile_oca
64
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__aggregate_name
65
+ msgid "Aggregate Name"
66
+ msgstr ""
67
+
68
+ #. module: account_reconcile_oca
69
+ #: model:ir.model.fields,help:account_reconcile_oca.field_account_journal__reconcile_aggregate
70
+ msgid "Aggregation to use on reconcile view"
71
+ msgstr ""
72
+
58
73
  #. module: account_reconcile_oca
59
74
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
60
75
  msgid "Amount"
@@ -87,6 +102,12 @@ msgstr ""
87
102
  msgid "Bank"
88
103
  msgstr "Banka"
89
104
 
105
+ #. module: account_reconcile_oca
106
+ #: model:ir.model,name:account_reconcile_oca.model_account_bank_statement
107
+ #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_bank_statement_form_edit
108
+ msgid "Bank Statement"
109
+ msgstr ""
110
+
90
111
  #. module: account_reconcile_oca
91
112
  #: model:ir.model,name:account_reconcile_oca.model_account_bank_statement_line
92
113
  msgid "Bank Statement Line"
@@ -122,6 +143,11 @@ msgstr ""
122
143
  msgid "Clean"
123
144
  msgstr ""
124
145
 
146
+ #. module: account_reconcile_oca
147
+ #: model:ir.model,name:account_reconcile_oca.model_res_company
148
+ msgid "Companies"
149
+ msgstr ""
150
+
125
151
  #. module: account_reconcile_oca
126
152
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__company_id
127
153
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__company_id
@@ -134,6 +160,11 @@ msgstr "Firma"
134
160
  msgid "Company related to this journal"
135
161
  msgstr ""
136
162
 
163
+ #. module: account_reconcile_oca
164
+ #: model:ir.model,name:account_reconcile_oca.model_res_config_settings
165
+ msgid "Config Settings"
166
+ msgstr ""
167
+
137
168
  #. module: account_reconcile_oca
138
169
  #. odoo-javascript
139
170
  #: code:addons/account_reconcile_oca/static/src/xml/reconcile.xml:0
@@ -162,6 +193,7 @@ msgstr "Alacak"
162
193
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__company_currency_id
163
194
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__currency_id
164
195
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__company_currency_id
196
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_journal__company_currency_id
165
197
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_reconcile_abstract__company_currency_id
166
198
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_reconcile_abstract__currency_id
167
199
  msgid "Currency"
@@ -179,6 +211,11 @@ msgstr "Veri"
179
211
  msgid "Date"
180
212
  msgstr "Tarih"
181
213
 
214
+ #. module: account_reconcile_oca
215
+ #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_aggregate__day
216
+ msgid "Day"
217
+ msgstr ""
218
+
182
219
  #. module: account_reconcile_oca
183
220
  #. odoo-javascript
184
221
  #: code:addons/account_reconcile_oca/static/src/xml/reconcile.xml:0
@@ -192,11 +229,21 @@ msgstr "Borç"
192
229
  msgid "Display Name"
193
230
  msgstr "Ad Görünümü"
194
231
 
232
+ #. module: account_reconcile_oca
233
+ #: model:ir.actions.act_window,name:account_reconcile_oca.account_bank_statement_action_edit
234
+ msgid "Edit Bank Statement"
235
+ msgstr ""
236
+
195
237
  #. module: account_reconcile_oca
196
238
  #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_mode__edit
197
239
  msgid "Edit Move"
198
240
  msgstr "Hareketi Düzenle"
199
241
 
242
+ #. module: account_reconcile_oca
243
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__statement_balance_end_real
244
+ msgid "Ending Balance"
245
+ msgstr ""
246
+
200
247
  #. module: account_reconcile_oca
201
248
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__foreign_currency_id
202
249
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__foreign_currency_id
@@ -214,6 +261,13 @@ msgstr ""
214
261
  msgid "From Trade Receivable accounts"
215
262
  msgstr ""
216
263
 
264
+ #. module: account_reconcile_oca
265
+ #. odoo-javascript
266
+ #: code:addons/account_reconcile_oca/static/src/xml/reconcile.xml:0
267
+ #, python-format
268
+ msgid "Global Balance"
269
+ msgstr ""
270
+
217
271
  #. module: account_reconcile_oca
218
272
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__id
219
273
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile_data__id
@@ -225,11 +279,21 @@ msgstr "ID"
225
279
  msgid "Invoice"
226
280
  msgstr "Fatura"
227
281
 
282
+ #. module: account_reconcile_oca
283
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__statement_complete
284
+ msgid "Is Complete"
285
+ msgstr ""
286
+
228
287
  #. module: account_reconcile_oca
229
288
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__is_reconciled
230
289
  msgid "Is Reconciled"
231
290
  msgstr "Uzlaştırıldı mı"
232
291
 
292
+ #. module: account_reconcile_oca
293
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__statement_valid
294
+ msgid "Is Valid"
295
+ msgstr ""
296
+
233
297
  #. module: account_reconcile_oca
234
298
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_journal_dashboard_kanban_view
235
299
  msgid "Items"
@@ -370,6 +434,11 @@ msgstr "Manuel İşlem"
370
434
  msgid "Miscellaneous"
371
435
  msgstr "Çeşitli"
372
436
 
437
+ #. module: account_reconcile_oca
438
+ #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_aggregate__month
439
+ msgid "Month"
440
+ msgstr ""
441
+
373
442
  #. module: account_reconcile_oca
374
443
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__name
375
444
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
@@ -438,6 +507,13 @@ msgstr "Alacak"
438
507
  msgid "Reconcile"
439
508
  msgstr "Uzlaştırma"
440
509
 
510
+ #. module: account_reconcile_oca
511
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__reconcile_aggregate
512
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_res_company__reconcile_aggregate
513
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_res_config_settings__reconcile_aggregate
514
+ msgid "Reconcile Aggregate"
515
+ msgstr ""
516
+
441
517
  #. module: account_reconcile_oca
442
518
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__reconcile_data
443
519
  msgid "Reconcile Data"
@@ -456,9 +532,14 @@ msgstr "Uzlaştırma Veri Bilgisi"
456
532
  msgid "Reconcile Mode"
457
533
  msgstr "Uzlaştırma Modu"
458
534
 
535
+ #. module: account_reconcile_oca
536
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_journal__reconcile_aggregate
537
+ #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.res_config_settings_form_view
538
+ msgid "Reconcile aggregation"
539
+ msgstr ""
540
+
459
541
  #. module: account_reconcile_oca
460
542
  #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_move_view_reconcile
461
- #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_reconcile
462
543
  #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_reconcile_all
463
544
  #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_reconcile_to_check
464
545
  msgid "Reconcile bank statement lines"
@@ -499,6 +580,27 @@ msgstr "Yemiye Öğelerini Ara"
499
580
  msgid "Set as Checked"
500
581
  msgstr "Gözden Geçirme İşaretlendi"
501
582
 
583
+ #. module: account_reconcile_oca
584
+ #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.res_config_settings_form_view
585
+ msgid "Standard aggregation to use on bank reconciliation"
586
+ msgstr ""
587
+
588
+ #. module: account_reconcile_oca
589
+ #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_aggregate__statement
590
+ #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_reconcile_view
591
+ msgid "Statement"
592
+ msgstr ""
593
+
594
+ #. module: account_reconcile_oca
595
+ #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__statement_name
596
+ msgid "Statement Name"
597
+ msgstr ""
598
+
599
+ #. module: account_reconcile_oca
600
+ #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_reconcile
601
+ msgid "Statement lines"
602
+ msgstr ""
603
+
502
604
  #. module: account_reconcile_oca
503
605
  #: model:ir.model.fields,help:account_reconcile_oca.field_account_bank_statement_line__foreign_currency_id
504
606
  msgid "The optional other currency if it is a multi-currency entry."
@@ -551,6 +653,11 @@ msgstr "Görme"
551
653
  msgid "View move"
552
654
  msgstr "Hareketi görüntüle"
553
655
 
656
+ #. module: account_reconcile_oca
657
+ #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_aggregate__week
658
+ msgid "Week"
659
+ msgstr ""
660
+
554
661
  #. module: account_reconcile_oca
555
662
  #. odoo-python
556
663
  #: code:addons/account_reconcile_oca/models/account_journal.py:0
@@ -1,5 +1,8 @@
1
1
  from . import account_reconcile_abstract
2
2
  from . import account_journal
3
3
  from . import account_bank_statement_line
4
+ from . import account_bank_statement
4
5
  from . import account_account_reconcile
5
6
  from . import account_move_line
7
+ from . import res_company
8
+ from . import res_config_settings
@@ -0,0 +1,15 @@
1
+ # Copyright 2024 Dixmit
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ from odoo import models
4
+
5
+
6
+ class AccountBankStatement(models.Model):
7
+ _inherit = "account.bank.statement"
8
+
9
+ def action_open_statement(self):
10
+ self.ensure_one()
11
+ action = self.env["ir.actions.act_window"]._for_xml_id(
12
+ "account_reconcile_oca.account_bank_statement_action_edit"
13
+ )
14
+ action["res_id"] = self.id
15
+ return action
@@ -3,6 +3,9 @@
3
3
 
4
4
  from collections import defaultdict
5
5
 
6
+ from dateutil import rrule
7
+ from dateutil.relativedelta import relativedelta
8
+
6
9
  from odoo import Command, _, api, fields, models
7
10
  from odoo.exceptions import UserError
8
11
  from odoo.tools import float_is_zero
@@ -86,6 +89,55 @@ 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
+ statement_complete = fields.Boolean(
93
+ related="statement_id.is_complete",
94
+ )
95
+ statement_valid = fields.Boolean(
96
+ related="statement_id.is_valid",
97
+ )
98
+ statement_balance_end_real = fields.Monetary(
99
+ related="statement_id.balance_end_real",
100
+ )
101
+ statement_name = fields.Char(
102
+ string="Statement Name",
103
+ related="statement_id.name",
104
+ )
105
+ reconcile_aggregate = fields.Char(compute="_compute_reconcile_aggregate")
106
+ aggregate_id = fields.Integer(compute="_compute_reconcile_aggregate")
107
+ aggregate_name = fields.Char(compute="_compute_reconcile_aggregate")
108
+
109
+ @api.model
110
+ def _reconcile_aggregate_map(self):
111
+ lang = self.env["res.lang"]._lang_get(self.env.user.lang)
112
+ week_start = rrule.weekday(int(lang.week_start) - 1)
113
+ return {
114
+ False: lambda s: (False, False),
115
+ "statement": lambda s: (s.statement_id.id, s.statement_id.name),
116
+ "day": lambda s: (s.date.toordinal(), s.date.strftime(lang.date_format)),
117
+ "week": lambda s: (
118
+ (s.date + relativedelta(weekday=week_start(-1))).toordinal(),
119
+ (s.date + relativedelta(weekday=week_start(-1))).strftime(
120
+ lang.date_format
121
+ ),
122
+ ),
123
+ "month": lambda s: (
124
+ s.date.replace(day=1).toordinal(),
125
+ s.date.replace(day=1).strftime(lang.date_format),
126
+ ),
127
+ }
128
+
129
+ @api.depends("company_id", "journal_id")
130
+ def _compute_reconcile_aggregate(self):
131
+ reconcile_aggregate_map = self._reconcile_aggregate_map()
132
+ for record in self:
133
+ reconcile_aggregate = (
134
+ record.journal_id.reconcile_aggregate
135
+ or record.company_id.reconcile_aggregate
136
+ )
137
+ record.reconcile_aggregate = reconcile_aggregate
138
+ record.aggregate_id, record.aggregate_name = reconcile_aggregate_map[
139
+ reconcile_aggregate
140
+ ](record)
89
141
 
90
142
  def save(self):
91
143
  return {"type": "ir.actions.act_window_close"}
@@ -752,3 +804,25 @@ class AccountBankStatementLine(models.Model):
752
804
  if vals["partner_id"] is False:
753
805
  vals["partner_id"] = (False, self.partner_name)
754
806
  return vals
807
+
808
+ def add_statement(self):
809
+ self.ensure_one()
810
+ action = self.env["ir.actions.act_window"]._for_xml_id(
811
+ "account_reconcile_oca.account_bank_statement_action_edit"
812
+ )
813
+ previous_line_with_statement = self.env["account.bank.statement.line"].search(
814
+ [
815
+ ("internal_index", "<", self.internal_index),
816
+ ("journal_id", "=", self.journal_id.id),
817
+ ("state", "=", "posted"),
818
+ ("statement_id", "!=", self.statement_id.id),
819
+ ("statement_id", "!=", False),
820
+ ],
821
+ limit=1,
822
+ )
823
+ action["context"] = {
824
+ "default_journal_id": self.journal_id.id,
825
+ "default_balance_start": previous_line_with_statement.statement_id.balance_end_real,
826
+ "split_line_id": self.id,
827
+ }
828
+ return action
@@ -12,6 +12,17 @@ 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()
@@ -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
+ )
@@ -366,7 +366,7 @@ 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:21e00920a952144136ed55f1d00b08be441b15d2291304304bfd77dfd76f9756
369
+ !! source digest: sha256:ae1b52beaba19e5505c337af5a93c52cf915340af8a58faf0ae74d79c378e6f7
370
370
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371
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/16.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-16-0/account-reconcile-16-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&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
372
  <p>This addon allows to reconcile bank statements and account marked as <cite>reconcile</cite>.</p>
@@ -1,7 +1,8 @@
1
1
  /** @odoo-module */
2
- const {useState, useSubEnv} = owl;
2
+ const {onMounted, onWillStart, useState, useSubEnv} = owl;
3
3
  import {KanbanController} from "@web/views/kanban/kanban_controller";
4
4
  import {View} from "@web/views/view";
5
+ import {formatMonetary} from "@web/views/fields/formatters";
5
6
  import {useService} from "@web/core/utils/hooks";
6
7
 
7
8
  export class ReconcileController extends KanbanController {
@@ -9,6 +10,8 @@ export class ReconcileController extends KanbanController {
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,
@@ -20,6 +23,39 @@ export class ReconcileController extends KanbanController {
20
23
  this.router = useService("router");
21
24
  this.activeActions = this.props.archInfo.activeActions;
22
25
  this.model.addEventListener("update", () => this.selectRecord(), {once: true});
26
+ onWillStart(() => {
27
+ this.updateJournalInfo();
28
+ });
29
+ onMounted(() => {
30
+ this.selectRecord();
31
+ });
32
+ }
33
+ get journalId() {
34
+ if (this.props.resModel === "account.bank.statement.line") {
35
+ return this.props.context.active_id;
36
+ }
37
+ return false;
38
+ }
39
+ async updateJournalInfo() {
40
+ var journalId = this.journalId;
41
+ if (!journalId) {
42
+ return;
43
+ }
44
+ var result = await this.orm.call("account.journal", "read", [
45
+ [journalId],
46
+ ["current_statement_balance", "currency_id", "company_currency_id"],
47
+ ]);
48
+ this.state.journalBalance = result[0].current_statement_balance;
49
+ this.state.currency = (result[0].currency_id ||
50
+ result[0].company_currency_id)[0];
51
+ }
52
+ get journalBalanceStr() {
53
+ if (!this.state.journalBalance) {
54
+ return "";
55
+ }
56
+ return formatMonetary(this.state.journalBalance, {
57
+ currencyId: this.state.currency,
58
+ });
23
59
  }
24
60
  exposeController(controller) {
25
61
  this.form_controller = controller;
@@ -45,6 +81,7 @@ export class ReconcileController extends KanbanController {
45
81
  return {
46
82
  resId: this.state.selectedRecordId,
47
83
  type: "form",
84
+ noBreadcrumbs: true,
48
85
  context: {
49
86
  ...(this.props.context || {}),
50
87
  form_view_ref: this.props.context.view_ref,
@@ -2,7 +2,59 @@
2
2
 
3
3
  import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
4
4
  import {ReconcileKanbanRecord} from "./reconcile_kanban_record.esm.js";
5
- export class ReconcileRenderer extends KanbanRenderer {}
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 ||
27
+ aggregates[aggregates.length - 1].id !== aggregateId)
28
+ ) {
29
+ aggregates.push({
30
+ id: aggregateId,
31
+ name: record.data.aggregate_name,
32
+ balance: record.data.statement_balance_end_real,
33
+ balanceStr: formatMonetary(record.data.statement_balance_end_real, {
34
+ currencyId: record.data.currency_id[0],
35
+ }),
36
+ });
37
+ }
38
+ }
39
+ return aggregates;
40
+ }
41
+ async onClickStatement(statementId) {
42
+ const action = await this.orm.call(
43
+ "account.bank.statement",
44
+ "action_open_statement",
45
+ [[statementId]],
46
+ {
47
+ context: this.props.context,
48
+ }
49
+ );
50
+ const model = this.props.list.model;
51
+ this.action.doAction(action, {
52
+ async onClose() {
53
+ model.root.load();
54
+ },
55
+ });
56
+ }
57
+ }
6
58
 
7
59
  ReconcileRenderer.components = {
8
60
  ...KanbanRenderer.components,
@@ -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();
@@ -45,7 +45,6 @@ export class AccountReconcileDataWidget extends Component {
45
45
  );
46
46
  data[line].amount_currency_format = fieldUtils.format.monetary(
47
47
  data[line].currency_amount,
48
- undefined,
49
48
  {
50
49
  currency: session.get_currency(data[line].line_currency_id),
51
50
  }
@@ -53,7 +52,6 @@ export class AccountReconcileDataWidget extends Component {
53
52
  if (data[line].original_amount) {
54
53
  data[line].original_amount_format = fieldUtils.format.monetary(
55
54
  data[line].original_amount,
56
- undefined,
57
55
  {
58
56
  currency: session.get_currency(data[line].currency_id),
59
57
  }
@@ -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
  }
@@ -6,6 +6,43 @@
6
6
  t-inherit-mode="primary"
7
7
  owl="1"
8
8
  >
9
+ <xpath expr="//t[@t-as='groupOrRecord']" position="before">
10
+ <div class="m-2 d-flex w-100" t-if="env.parentController.journalId">
11
+ <span
12
+ class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
13
+ >Global Balance</span>
14
+ <span
15
+ class="pe-0 fw-bold fs-4 align-self-center"
16
+ t-esc="env.parentController.journalBalanceStr"
17
+ />
18
+ </div>
19
+ <t t-set="aggregates" t-value="getAggregates()" />
20
+ </xpath>
21
+ <xpath expr="//t[@t-else='']/KanbanRecord" position="before">
22
+ <t
23
+ t-if="aggregates.length and groupOrRecord.record.data.aggregate_id and aggregates[0].id == groupOrRecord.record.data.aggregate_id"
24
+ >
25
+ <t t-set="aggregate" t-value="aggregates.shift()" />
26
+ <div class="m-2 d-flex w-100">
27
+ <span
28
+ class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
29
+ t-esc="aggregate.name"
30
+ />
31
+ <span
32
+ t-if="groupOrRecord.record.data.reconcile_aggregate == 'statement'"
33
+ t-on-click="() => this.onClickStatement(aggregate.id)"
34
+ class="pe-0 fw-bold fs-4 align-self-center btn btn-link"
35
+ t-esc="aggregate.balanceStr"
36
+ />
37
+ <!--
38
+ <span
39
+ t-if="groupOrRecord.record.data.reconcile_aggregate != 'statement'"
40
+ class="pe-0 fw-bold fs-4 align-self-center text-link"
41
+ t-esc="aggregate.balanceStr"
42
+ />-->
43
+ </div>
44
+ </t>
45
+ </xpath>
9
46
  <xpath expr="div[hasclass('o_kanban_renderer')]" position="attributes">
10
47
  <attribute
11
48
  name="class"
@@ -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
+ attrs="{'invisible': [('is_valid', '=',True), ('is_complete','=',True)]}"
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>