odoo-addon-account-reconcile-oca 16.0.1.2.12.2__py3-none-any.whl → 17.0.1.0.0.20__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 (58) hide show
  1. odoo/addons/account_reconcile_oca/README.rst +19 -18
  2. odoo/addons/account_reconcile_oca/__manifest__.py +4 -1
  3. odoo/addons/account_reconcile_oca/hooks.py +2 -2
  4. odoo/addons/account_reconcile_oca/i18n/account_reconcile_oca.pot +89 -8
  5. odoo/addons/account_reconcile_oca/i18n/ca.po +0 -5
  6. odoo/addons/account_reconcile_oca/i18n/es.po +2 -7
  7. odoo/addons/account_reconcile_oca/i18n/fr.po +0 -5
  8. odoo/addons/account_reconcile_oca/i18n/hr.po +0 -5
  9. odoo/addons/account_reconcile_oca/i18n/nl.po +0 -5
  10. odoo/addons/account_reconcile_oca/i18n/pt_BR.po +0 -5
  11. odoo/addons/account_reconcile_oca/i18n/sv.po +34 -39
  12. odoo/addons/account_reconcile_oca/i18n/tr.po +0 -5
  13. odoo/addons/account_reconcile_oca/models/__init__.py +3 -0
  14. odoo/addons/account_reconcile_oca/models/account_account_reconcile.py +2 -2
  15. odoo/addons/account_reconcile_oca/models/account_bank_statement.py +15 -0
  16. odoo/addons/account_reconcile_oca/models/account_bank_statement_line.py +98 -19
  17. odoo/addons/account_reconcile_oca/models/account_journal.py +15 -1
  18. odoo/addons/account_reconcile_oca/models/account_move_line.py +0 -1
  19. odoo/addons/account_reconcile_oca/models/account_reconcile_abstract.py +4 -2
  20. odoo/addons/account_reconcile_oca/models/res_company.py +14 -0
  21. odoo/addons/account_reconcile_oca/models/res_config_settings.py +12 -0
  22. odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.md +1 -0
  23. odoo/addons/account_reconcile_oca/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -1
  24. odoo/addons/account_reconcile_oca/readme/ROADMAP.md +3 -0
  25. odoo/addons/account_reconcile_oca/readme/USAGE.md +10 -0
  26. odoo/addons/account_reconcile_oca/static/description/index.html +10 -9
  27. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +44 -4
  28. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_renderer.esm.js +52 -1
  29. odoo/addons/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +3 -0
  30. odoo/addons/account_reconcile_oca/static/src/js/reconcile_manual/reconcile_manual_controller.esm.js +3 -0
  31. odoo/addons/account_reconcile_oca/static/src/js/reconcile_move_line/reconcile_move_line_renderer.esm.js +1 -1
  32. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js +11 -4
  33. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +22 -33
  34. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_move_line_widget.esm.js +62 -6
  35. odoo/addons/account_reconcile_oca/static/src/js/widgets/selection_badge_uncheck.esm.js +10 -1
  36. odoo/addons/account_reconcile_oca/static/src/scss/reconcile.scss +16 -15
  37. odoo/addons/account_reconcile_oca/static/src/xml/reconcile.xml +44 -10
  38. odoo/addons/account_reconcile_oca/tests/test_account_reconcile.py +15 -9
  39. odoo/addons/account_reconcile_oca/tests/test_bank_account_reconcile.py +28 -21
  40. odoo/addons/account_reconcile_oca/views/account_account.xml +3 -3
  41. odoo/addons/account_reconcile_oca/views/account_account_reconcile.xml +7 -7
  42. odoo/addons/account_reconcile_oca/views/account_bank_statement.xml +46 -0
  43. odoo/addons/account_reconcile_oca/views/account_bank_statement_line.xml +71 -37
  44. odoo/addons/account_reconcile_oca/views/account_journal.xml +10 -4
  45. odoo/addons/account_reconcile_oca/views/account_move.xml +1 -1
  46. odoo/addons/account_reconcile_oca/views/account_move_line.xml +8 -3
  47. odoo/addons/account_reconcile_oca/views/res_config_settings.xml +24 -0
  48. {odoo_addon_account_reconcile_oca-16.0.1.2.12.2.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info}/METADATA +27 -28
  49. odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info/RECORD +64 -0
  50. {odoo_addon_account_reconcile_oca-16.0.1.2.12.2.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info}/WHEEL +1 -1
  51. odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info/top_level.txt +1 -0
  52. odoo/addons/account_reconcile_oca/i18n/it.po +0 -598
  53. odoo/addons/account_reconcile_oca/migrations/16.0.1.2.0/pre-migration.py +0 -23
  54. odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.rst +0 -1
  55. odoo/addons/account_reconcile_oca/readme/ROADMAP.rst +0 -3
  56. odoo/addons/account_reconcile_oca/readme/USAGE.rst +0 -12
  57. odoo_addon_account_reconcile_oca-16.0.1.2.12.2.dist-info/RECORD +0 -61
  58. odoo_addon_account_reconcile_oca-16.0.1.2.12.2.dist-info/top_level.txt +0 -1
@@ -6,7 +6,7 @@ msgid ""
6
6
  msgstr ""
7
7
  "Project-Id-Version: Odoo Server 16.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
- "PO-Revision-Date: 2024-02-27 15:36+0000\n"
9
+ "PO-Revision-Date: 2023-10-28 13:19+0000\n"
10
10
  "Last-Translator: jakobkrabbe <jakob@syscare.se>\n"
11
11
  "Language-Team: none\n"
12
12
  "Language: sv\n"
@@ -51,7 +51,7 @@ msgstr "Sammanfattning av kontoavstämning"
51
51
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__add_account_move_line_id
52
52
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_reconcile_abstract__add_account_move_line_id
53
53
  msgid "Add Account Move Line"
54
- msgstr "Lägg till transaktion"
54
+ msgstr "Lägg till konto, move_line"
55
55
 
56
56
  #. module: account_reconcile_oca
57
57
  #: model:ir.actions.act_window,name:account_reconcile_oca.action_bank_statement_line_create
@@ -73,17 +73,17 @@ msgstr "Belopp i valuta"
73
73
  #. module: account_reconcile_oca
74
74
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__analytic_distribution
75
75
  msgid "Analytic Distribution"
76
- msgstr "Objektfördelning"
76
+ msgstr "Analytisk distribution"
77
77
 
78
78
  #. module: account_reconcile_oca
79
79
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__analytic_precision
80
80
  msgid "Analytic Precision"
81
- msgstr "Objektkontoprecision"
81
+ msgstr "Analytisk precision"
82
82
 
83
83
  #. module: account_reconcile_oca
84
84
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
85
85
  msgid "Are you sure that the move should be unreconciled?"
86
- msgstr "Är du säker på att verifikatet ska vara oavstämnt?"
86
+ msgstr "Är du säker på att flytten borde vara oförenlig?"
87
87
 
88
88
  #. module: account_reconcile_oca
89
89
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
@@ -103,7 +103,7 @@ msgstr "Bankavstämning"
103
103
  #. module: account_reconcile_oca
104
104
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__can_reconcile
105
105
  msgid "Can Reconcile"
106
- msgstr "Kan avstämmas"
106
+ msgstr "Kan förenas"
107
107
 
108
108
  #. module: account_reconcile_oca
109
109
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_add_view
@@ -113,12 +113,12 @@ msgstr "Avbryt"
113
113
  #. module: account_reconcile_oca
114
114
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
115
115
  msgid "Cash"
116
- msgstr "Kontant"
116
+ msgstr "Cash"
117
117
 
118
118
  #. module: account_reconcile_oca
119
119
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
120
120
  msgid "Chatter"
121
- msgstr "Logg"
121
+ msgstr "Chatter"
122
122
 
123
123
  #. module: account_reconcile_oca
124
124
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_account_reconcile_form_view
@@ -130,12 +130,12 @@ msgstr "Rensa"
130
130
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__company_id
131
131
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_reconcile_abstract__company_id
132
132
  msgid "Company"
133
- msgstr "Bolag"
133
+ msgstr "Företag"
134
134
 
135
135
  #. module: account_reconcile_oca
136
136
  #: model:ir.model.fields,help:account_reconcile_oca.field_account_bank_statement_line__company_id
137
137
  msgid "Company related to this journal"
138
- msgstr "Bolag relaterad till denna journalen"
138
+ msgstr "Företag relaterad till denna journalen"
139
139
 
140
140
  #. module: account_reconcile_oca
141
141
  #. odoo-javascript
@@ -195,15 +195,10 @@ msgstr "Debitera"
195
195
  msgid "Display Name"
196
196
  msgstr "Visningsnamn"
197
197
 
198
- #. module: account_reconcile_oca
199
- #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_move_line__invoice_due_date
200
- msgid "Due Date"
201
- msgstr "Förfallodatum"
202
-
203
198
  #. module: account_reconcile_oca
204
199
  #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_mode__edit
205
200
  msgid "Edit Move"
206
- msgstr "Redigera verifikat"
201
+ msgstr "Redigera Move"
207
202
 
208
203
  #. module: account_reconcile_oca
209
204
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__foreign_currency_id
@@ -215,7 +210,7 @@ msgstr "Utländsk valuta"
215
210
  #. module: account_reconcile_oca
216
211
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
217
212
  msgid "From Trade Payable accounts"
218
- msgstr "Från leverantörsskulder"
213
+ msgstr "Från Leverantörsskulder"
219
214
 
220
215
  #. module: account_reconcile_oca
221
216
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
@@ -241,40 +236,40 @@ msgstr "Är försonad"
241
236
  #. module: account_reconcile_oca
242
237
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_journal_dashboard_kanban_view
243
238
  msgid "Items"
244
- msgstr "Transaktioner"
239
+ msgstr "Föremål"
245
240
 
246
241
  #. module: account_reconcile_oca
247
242
  #: model:ir.model,name:account_reconcile_oca.model_account_journal
248
243
  msgid "Journal"
249
- msgstr "Journal"
244
+ msgstr "Dagbok"
250
245
 
251
246
  #. module: account_reconcile_oca
252
247
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__currency_id
253
248
  msgid "Journal Currency"
254
- msgstr "Journalvaluta"
249
+ msgstr "Dagboksvaluta"
255
250
 
256
251
  #. module: account_reconcile_oca
257
252
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
258
253
  msgid "Journal Entry"
259
- msgstr "Verifikat"
254
+ msgstr "Dagboksanteckning"
260
255
 
261
256
  #. module: account_reconcile_oca
262
257
  #: model:ir.model,name:account_reconcile_oca.model_account_move_line
263
258
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
264
259
  msgid "Journal Item"
265
- msgstr "Transaktioner"
260
+ msgstr "Dagboksanteckning"
266
261
 
267
262
  #. module: account_reconcile_oca
268
263
  #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_mode__keep
269
264
  msgid "Keep Suspense Accounts"
270
- msgstr "Behåll observationskonto"
265
+ msgstr "Håll avstängningskonton"
271
266
 
272
267
  #. module: account_reconcile_oca
273
268
  #. odoo-python
274
269
  #: code:addons/account_reconcile_oca/models/account_bank_statement_line.py:0
275
270
  #, python-format
276
271
  msgid "Keep suspense move lines mode cannot be unreconciled"
277
- msgstr "Behåll observationstransaktioner, läge kan inte vara oavstämd"
272
+ msgstr ""
278
273
 
279
274
  #. module: account_reconcile_oca
280
275
  #. odoo-javascript
@@ -329,7 +324,7 @@ msgstr "Manuell typ"
329
324
  #. module: account_reconcile_oca
330
325
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_line_id
331
326
  msgid "Manual Line"
332
- msgstr "Manuell rad"
327
+ msgstr "Manuell Linje"
333
328
 
334
329
  #. module: account_reconcile_oca
335
330
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_model_id
@@ -339,12 +334,12 @@ msgstr "Manuell modell"
339
334
  #. module: account_reconcile_oca
340
335
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_move_id
341
336
  msgid "Manual Move"
342
- msgstr "Manuellt verifikat"
337
+ msgstr "Manuell Move"
343
338
 
344
339
  #. module: account_reconcile_oca
345
340
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_move_type
346
341
  msgid "Manual Move Type"
347
- msgstr "Manuell verifikattyp"
342
+ msgstr ""
348
343
 
349
344
  #. module: account_reconcile_oca
350
345
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_name
@@ -359,7 +354,7 @@ msgstr "Manuell ursprunglig summa"
359
354
  #. module: account_reconcile_oca
360
355
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__manual_partner_id
361
356
  msgid "Manual Partner"
362
- msgstr "Manuell kontakt"
357
+ msgstr "Manuell partner"
363
358
 
364
359
  #. module: account_reconcile_oca
365
360
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile__manual_reference
@@ -387,14 +382,14 @@ msgstr "Namn"
387
382
  #. module: account_reconcile_oca
388
383
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
389
384
  msgid "Narration"
390
- msgstr "Beskrivning"
385
+ msgstr "Berättande"
391
386
 
392
387
  #. module: account_reconcile_oca
393
388
  #. odoo-python
394
389
  #: code:addons/account_reconcile_oca/models/account_bank_statement_line.py:0
395
390
  #, python-format
396
391
  msgid "No supense lines are allowed when reconciling"
397
- msgstr "Inga observationsrader är tillåtna vid avstämning"
392
+ msgstr "Inga supensrader är tillåtna vid avstämning"
398
393
 
399
394
  #. module: account_reconcile_oca
400
395
  #: model_terms:ir.actions.act_window,help:account_reconcile_oca.action_bank_statement_line_reconcile_to_check
@@ -406,7 +401,7 @@ msgstr "Inget att kontrollera"
406
401
  #: model_terms:ir.actions.act_window,help:account_reconcile_oca.action_bank_statement_line_reconcile
407
402
  #: model_terms:ir.actions.act_window,help:account_reconcile_oca.action_bank_statement_line_reconcile_all
408
403
  msgid "Nothing to reconcile"
409
- msgstr "Inget att stämma av"
404
+ msgstr "Inget att förena"
410
405
 
411
406
  #. module: account_reconcile_oca
412
407
  #. odoo-javascript
@@ -415,7 +410,7 @@ msgstr "Inget att stämma av"
415
410
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
416
411
  #, python-format
417
412
  msgid "Partner"
418
- msgstr "Kontakt"
413
+ msgstr "Partner"
419
414
 
420
415
  #. module: account_reconcile_oca
421
416
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
@@ -430,7 +425,7 @@ msgstr "Inköp"
430
425
  #. module: account_reconcile_oca
431
426
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
432
427
  msgid "Receivable"
433
- msgstr "Kundfordringar"
428
+ msgstr "Mottagningsbar"
434
429
 
435
430
  #. module: account_reconcile_oca
436
431
  #: model:ir.actions.act_window,name:account_reconcile_oca.account_account_account_account_reconcile_act_window
@@ -444,7 +439,7 @@ msgstr "Kundfordringar"
444
439
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
445
440
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.view_account_list
446
441
  msgid "Reconcile"
447
- msgstr "Stämma av"
442
+ msgstr "Avstämma"
448
443
 
449
444
  #. module: account_reconcile_oca
450
445
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_bank_statement_line__reconcile_data
@@ -475,7 +470,7 @@ msgstr "Stämma av kontoutdragsrader"
475
470
  #. module: account_reconcile_oca
476
471
  #: model:ir.model,name:account_reconcile_oca.model_account_account_reconcile_data
477
472
  msgid "Reconcile data model to store user info"
478
- msgstr "Datamodell för att lagra avstämd användarinformation"
473
+ msgstr "Avstämma datamodell för att lagra användarinformation"
479
474
 
480
475
  #. module: account_reconcile_oca
481
476
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_reconcile_view
@@ -500,7 +495,7 @@ msgstr "Spara"
500
495
  #. module: account_reconcile_oca
501
496
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.account_move_line_search_reconcile_view
502
497
  msgid "Search Journal Items"
503
- msgstr "Sök transaktion"
498
+ msgstr "Sök journalföremål"
504
499
 
505
500
  #. module: account_reconcile_oca
506
501
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
@@ -537,7 +532,7 @@ msgstr "Odefinierad"
537
532
  #. module: account_reconcile_oca
538
533
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
539
534
  msgid "Unreconcile"
540
- msgstr "Oavstämnd"
535
+ msgstr ""
541
536
 
542
537
  #. module: account_reconcile_oca
543
538
  #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_account_reconcile_data__user_id
@@ -557,7 +552,7 @@ msgstr "Vy"
557
552
  #. module: account_reconcile_oca
558
553
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
559
554
  msgid "View move"
560
- msgstr "Visa verifikat"
555
+ msgstr "Visa move"
561
556
 
562
557
  #. module: account_reconcile_oca
563
558
  #. odoo-python
@@ -571,7 +566,7 @@ msgstr "Bra gjort! Allt har blivit avstämmt"
571
566
  #: code:addons/account_reconcile_oca/models/account_move_line.py:0
572
567
  #, python-format
573
568
  msgid "You can only reconcile journal items belonging to the same account."
574
- msgstr "Du kan bara stämma av transaktioner som hör till samma konto."
569
+ msgstr ""
575
570
 
576
571
  #. module: account_reconcile_oca
577
572
  #: model_terms:ir.ui.view,arch_db:account_reconcile_oca.bank_statement_line_form_reconcile_view
@@ -192,11 +192,6 @@ msgstr "Borç"
192
192
  msgid "Display Name"
193
193
  msgstr "Ad Görünümü"
194
194
 
195
- #. module: account_reconcile_oca
196
- #: model:ir.model.fields,field_description:account_reconcile_oca.field_account_move_line__invoice_due_date
197
- msgid "Due Date"
198
- msgstr ""
199
-
200
195
  #. module: account_reconcile_oca
201
196
  #: model:ir.model.fields.selection,name:account_reconcile_oca.selection__account_journal__reconcile_mode__edit
202
197
  msgid "Edit Move"
@@ -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
@@ -24,7 +24,7 @@ class AccountAccountReconcile(models.Model):
24
24
 
25
25
  @property
26
26
  def _table_query(self):
27
- return "%s %s %s %s %s" % (
27
+ return "{} {} {} {} {}".format(
28
28
  self._select(),
29
29
  self._from(),
30
30
  self._where(),
@@ -52,7 +52,7 @@ class AccountAccountReconcile(models.Model):
52
52
  FALSE as is_reconciled,
53
53
  aml.currency_id as currency_id,
54
54
  a.company_id,
55
- false as foreign_currency_id
55
+ null as foreign_currency_id
56
56
  """
57
57
 
58
58
  def _from(self):
@@ -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,7 +3,10 @@
3
3
 
4
4
  from collections import defaultdict
5
5
 
6
- from odoo import Command, _, api, fields, models
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": self.journal_id.suspense_account_id.name_get()[0],
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.name_get()[0]
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 self.manual_partner_id.name_get()[0]
300
- or (False, self.partner_name),
301
- "account_id": self.manual_account_id.name_get()[0]
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": self.env["account.account"]
385
- .browse(line["account_id"])
386
- .name_get()[0],
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
- self.env["res.partner"].browse(line["partner_id"]).name_get()[0]
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.name_get()[0],
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 self.get_journal_dashboard_datas()["number_to_reconcile"] > 0:
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")
@@ -6,7 +6,6 @@ from odoo.exceptions import ValidationError
6
6
 
7
7
 
8
8
  class AccountMoveLine(models.Model):
9
-
10
9
  _inherit = "account.move.line"
11
10
 
12
11
  invoice_due_date = fields.Date(
@@ -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.name_get()[0],
72
- "partner_id": line.partner_id and line.partner_id.name_get()[0] or False,
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 `reconcile`.
1
+ This addon allows to reconcile bank statements and account marked as
2
+ reconcile.
@@ -0,0 +1,3 @@
1
+ The following bugs are already detected:
2
+
3
+ - Creation of activities on the chatter do show automatically
@@ -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.