odoo-addon-account-reconcile-oca 17.0.1.2.6__py3-none-any.whl → 17.0.1.3.0.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 (26) hide show
  1. odoo/addons/account_reconcile_oca/README.rst +1 -1
  2. odoo/addons/account_reconcile_oca/__manifest__.py +1 -1
  3. odoo/addons/account_reconcile_oca/i18n/account_reconcile_oca.pot +21 -0
  4. odoo/addons/account_reconcile_oca/i18n/ca.po +21 -0
  5. odoo/addons/account_reconcile_oca/i18n/es.po +21 -0
  6. odoo/addons/account_reconcile_oca/i18n/fr.po +21 -0
  7. odoo/addons/account_reconcile_oca/i18n/hr.po +21 -0
  8. odoo/addons/account_reconcile_oca/i18n/it.po +21 -0
  9. odoo/addons/account_reconcile_oca/i18n/nl.po +21 -0
  10. odoo/addons/account_reconcile_oca/i18n/pt.po +21 -0
  11. odoo/addons/account_reconcile_oca/i18n/pt_BR.po +21 -0
  12. odoo/addons/account_reconcile_oca/i18n/sv.po +21 -0
  13. odoo/addons/account_reconcile_oca/i18n/tr.po +21 -0
  14. odoo/addons/account_reconcile_oca/i18n/zh.po +21 -0
  15. odoo/addons/account_reconcile_oca/i18n/zh_CN.po +21 -0
  16. odoo/addons/account_reconcile_oca/models/account_account_reconcile.py +4 -5
  17. odoo/addons/account_reconcile_oca/models/account_bank_statement_line.py +215 -92
  18. odoo/addons/account_reconcile_oca/models/account_reconcile_abstract.py +19 -22
  19. odoo/addons/account_reconcile_oca/static/description/index.html +1 -1
  20. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +2 -0
  21. odoo/addons/account_reconcile_oca/tests/test_bank_account_reconcile.py +142 -0
  22. odoo/addons/account_reconcile_oca/views/account_bank_statement_line.xml +15 -4
  23. {odoo_addon_account_reconcile_oca-17.0.1.2.6.dist-info → odoo_addon_account_reconcile_oca-17.0.1.3.0.1.dist-info}/METADATA +2 -2
  24. {odoo_addon_account_reconcile_oca-17.0.1.2.6.dist-info → odoo_addon_account_reconcile_oca-17.0.1.3.0.1.dist-info}/RECORD +26 -26
  25. {odoo_addon_account_reconcile_oca-17.0.1.2.6.dist-info → odoo_addon_account_reconcile_oca-17.0.1.3.0.1.dist-info}/WHEEL +1 -1
  26. {odoo_addon_account_reconcile_oca-17.0.1.2.6.dist-info → odoo_addon_account_reconcile_oca-17.0.1.3.0.1.dist-info}/top_level.txt +0 -0
@@ -60,6 +60,19 @@ class AccountBankStatementLine(models.Model):
60
60
  "Percentage Analytic"
61
61
  ),
62
62
  )
63
+ manual_in_currency = fields.Boolean(readonly=True, store=False, prefetch=False)
64
+ manual_in_currency_id = fields.Many2one(
65
+ "res.currency", readonly=True, store=False, prefetch=False
66
+ )
67
+ manual_amount_in_currency = fields.Monetary(
68
+ store=False,
69
+ default=False,
70
+ prefetch=False,
71
+ currency_field="manual_in_currency_id",
72
+ )
73
+ manual_exchange_counterpart = fields.Boolean(
74
+ store=False,
75
+ )
63
76
  manual_model_id = fields.Many2one(
64
77
  "account.reconcile.model",
65
78
  check_company=True,
@@ -176,26 +189,19 @@ class AccountBankStatementLine(models.Model):
176
189
  else:
177
190
  new_data.append(line)
178
191
  if is_new_line:
179
- new_data.append(
180
- self._get_reconcile_line(
181
- self.add_account_move_line_id, "other", True, pending_amount
182
- )
192
+ reconcile_auxiliary_id, lines = self._get_reconcile_line(
193
+ self.add_account_move_line_id, "other", True, pending_amount
183
194
  )
195
+ new_data += lines
184
196
  self.reconcile_data_info = self._recompute_suspense_line(
185
197
  new_data,
186
198
  self.reconcile_data_info["reconcile_auxiliary_id"],
187
199
  self.manual_reference,
188
- exchange_recompute=True,
189
200
  )
190
201
  self.can_reconcile = self.reconcile_data_info.get("can_reconcile", False)
191
202
  self.add_account_move_line_id = False
192
203
 
193
- def _recompute_suspense_line(
194
- self, data, reconcile_auxiliary_id, manual_reference, exchange_recompute=False
195
- ):
196
- reconcile_auxiliary_id = self._compute_exchange_rate(
197
- data, reconcile_auxiliary_id, exchange_recompute=exchange_recompute
198
- )
204
+ def _recompute_suspense_line(self, data, reconcile_auxiliary_id, manual_reference):
199
205
  can_reconcile = True
200
206
  total_amount = 0
201
207
  new_data = []
@@ -275,15 +281,29 @@ class AccountBankStatementLine(models.Model):
275
281
  self.ensure_one()
276
282
  data = self.reconcile_data_info.get("data", [])
277
283
  new_data = []
284
+ related_move_line_id = False
285
+ for line in data:
286
+ if line.get("reference") == self.manual_reference:
287
+ related_move_line_id = line.get("id")
288
+ break
278
289
  for line in data:
290
+ if (
291
+ self.manual_delete
292
+ and related_move_line_id
293
+ and line.get("original_exchange_line_id") == related_move_line_id
294
+ ):
295
+ # We should remove the related exchange rate line
296
+ continue
279
297
  if line["reference"] == self.manual_reference:
280
298
  if self.manual_delete:
281
299
  self.update(
282
300
  {
283
- "manual_delete": False,
284
301
  "manual_reference": False,
285
302
  "manual_account_id": False,
286
303
  "manual_amount": False,
304
+ "manual_exchange_counterpart": False,
305
+ "manual_in_currency_id": False,
306
+ "manual_in_currency": False,
287
307
  "manual_name": False,
288
308
  "manual_partner_id": False,
289
309
  "manual_line_id": False,
@@ -293,6 +313,7 @@ class AccountBankStatementLine(models.Model):
293
313
  "manual_original_amount": False,
294
314
  "manual_currency_id": False,
295
315
  "analytic_distribution": False,
316
+ "manual_amount_in_currency": False,
296
317
  }
297
318
  )
298
319
  continue
@@ -300,11 +321,22 @@ class AccountBankStatementLine(models.Model):
300
321
  self.manual_account_id = line["account_id"][0]
301
322
  self.manual_amount = line["amount"]
302
323
  self.manual_currency_id = line["currency_id"]
324
+ self.manual_in_currency_id = line.get("line_currency_id")
325
+ self.manual_in_currency = line.get("line_currency_id") and line[
326
+ "currency_id"
327
+ ] != line.get("line_currency_id")
328
+ self.manual_amount_in_currency = line.get("currency_amount")
303
329
  self.manual_name = line["name"]
330
+ self.manual_exchange_counterpart = line.get(
331
+ "is_exchange_counterpart", False
332
+ )
304
333
  self.manual_partner_id = (
305
334
  line.get("partner_id") and line["partner_id"][0]
306
335
  )
307
- self.manual_line_id = line["id"]
336
+ manual_line = (
337
+ self.env["account.move.line"].browse(line["id"]).exists()
338
+ )
339
+ self.manual_line_id = manual_line
308
340
  self.analytic_distribution = line.get("analytic_distribution", {})
309
341
  if self.manual_line_id:
310
342
  self.manual_move_id = self.manual_line_id.move_id
@@ -312,6 +344,7 @@ class AccountBankStatementLine(models.Model):
312
344
  self.manual_kind = line["kind"]
313
345
  self.manual_original_amount = line.get("original_amount", 0.0)
314
346
  new_data.append(line)
347
+ self.update({"manual_delete": False})
315
348
  self.reconcile_data_info = self._recompute_suspense_line(
316
349
  new_data,
317
350
  self.reconcile_data_info["reconcile_auxiliary_id"],
@@ -319,6 +352,17 @@ class AccountBankStatementLine(models.Model):
319
352
  )
320
353
  self.can_reconcile = self.reconcile_data_info.get("can_reconcile", False)
321
354
 
355
+ @api.onchange("manual_amount_in_currency")
356
+ def _onchange_manual_amount_in_currency(self):
357
+ if self.manual_line_id.exists() and self.manual_line_id:
358
+ self.manual_amount = self.manual_in_currency_id._convert(
359
+ self.manual_amount_in_currency,
360
+ self.company_id.currency_id,
361
+ self.company_id,
362
+ self.manual_line_id.date,
363
+ )
364
+ self._onchange_manual_reconcile_vals()
365
+
322
366
  @api.onchange(
323
367
  "manual_account_id",
324
368
  "manual_partner_id",
@@ -364,6 +408,23 @@ class AccountBankStatementLine(models.Model):
364
408
  )
365
409
  if line["kind"] == "liquidity":
366
410
  self._update_move_partner()
411
+ if self.manual_line_id and self.manual_line_id.id == line.get(
412
+ "original_exchange_line_id"
413
+ ):
414
+ # Now, we should edit the amount of the exchange rate
415
+ amount = self._get_exchange_rate_amount(
416
+ self.manual_amount,
417
+ self.manual_amount_in_currency,
418
+ self.manual_line_id.currency_id,
419
+ self.manual_line_id,
420
+ )
421
+ line.update(
422
+ {
423
+ "amount": amount,
424
+ "credit": -amount if amount < 0 else 0.0,
425
+ "debit": amount if amount > 0 else 0.0,
426
+ }
427
+ )
367
428
  new_data.append(line)
368
429
  self.reconcile_data_info = self._recompute_suspense_line(
369
430
  new_data,
@@ -377,7 +438,7 @@ class AccountBankStatementLine(models.Model):
377
438
  return
378
439
  self.partner_id = self.manual_partner_id
379
440
 
380
- @api.depends("reconcile_data")
441
+ @api.depends("reconcile_data", "is_reconciled")
381
442
  def _compute_reconcile_data_info(self):
382
443
  for record in self:
383
444
  if record.reconcile_data:
@@ -451,49 +512,15 @@ class AccountBankStatementLine(models.Model):
451
512
  new_data.append(new_line)
452
513
  return new_data, reconcile_auxiliary_id
453
514
 
454
- def _compute_exchange_rate(
455
- self, data, reconcile_auxiliary_id, exchange_recompute=False
456
- ):
457
- if not exchange_recompute:
458
- return reconcile_auxiliary_id
459
- foreign_currency = (
460
- self.currency_id != self.company_id.currency_id
461
- or self.foreign_currency_id
462
- or any(line["currency_id"] != line["line_currency_id"] for line in data)
463
- )
464
- if not foreign_currency or self.is_reconciled:
465
- return reconcile_auxiliary_id
466
- currency = self.journal_id.currency_id or self.company_id.currency_id
467
- amount = sum(d.get("net_amount", 0) for d in data)
468
- if not currency.is_zero(amount):
469
- account = self.company_id.expense_currency_exchange_account_id
470
- if amount > 0:
471
- account = self.company_id.income_currency_exchange_account_id
472
- data.append(
473
- {
474
- "reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
475
- "id": False,
476
- "account_id": [account.id, account.display_name],
477
- "partner_id": False,
478
- "date": fields.Date.to_string(self.date),
479
- "name": self.payment_ref or self.name,
480
- "amount": -amount,
481
- "net_amount": -amount,
482
- "credit": amount if amount > 0 else 0.0,
483
- "debit": -amount if amount < 0 else 0.0,
484
- "kind": "other",
485
- "currency_id": self.currency_id.id,
486
- "line_currency_id": self.currency_id.id,
487
- "currency_amount": -amount,
488
- }
489
- )
490
- reconcile_auxiliary_id += 1
491
- return reconcile_auxiliary_id
492
-
493
515
  def _default_reconcile_data(self, from_unreconcile=False):
494
516
  liquidity_lines, suspense_lines, other_lines = self._seek_for_lines()
495
- data = [self._get_reconcile_line(line, "liquidity") for line in liquidity_lines]
517
+ data = []
496
518
  reconcile_auxiliary_id = 1
519
+ for line in liquidity_lines:
520
+ reconcile_auxiliary_id, lines = self._get_reconcile_line(
521
+ line, "liquidity", reconcile_auxiliary_id=reconcile_auxiliary_id
522
+ )
523
+ data += lines
497
524
  if not from_unreconcile:
498
525
  res = (
499
526
  self.env["account.reconcile.model"]
@@ -508,30 +535,31 @@ class AccountBankStatementLine(models.Model):
508
535
  data, res["model"], reconcile_auxiliary_id
509
536
  ),
510
537
  self.manual_reference,
511
- exchange_recompute=True,
512
538
  )
513
539
  elif res and res.get("amls"):
514
540
  amount = self.amount_total_signed
515
541
  for line in res.get("amls", []):
516
- line_data = self._get_reconcile_line(
517
- line, "other", is_counterpart=True, max_amount=amount
542
+ reconcile_auxiliary_id, line_data = self._get_reconcile_line(
543
+ line,
544
+ "other",
545
+ is_counterpart=True,
546
+ max_amount=amount,
547
+ reconcile_auxiliary_id=reconcile_auxiliary_id,
518
548
  )
519
- amount -= line_data.get("amount")
520
- data.append(line_data)
549
+ amount -= sum(line.get("amount") for line in line_data)
550
+ data += line_data
521
551
  return self._recompute_suspense_line(
522
552
  data,
523
553
  reconcile_auxiliary_id,
524
554
  self.manual_reference,
525
- exchange_recompute=True,
526
555
  )
556
+ for line in other_lines:
557
+ reconcile_auxiliary_id, lines = self._get_reconcile_line(
558
+ line, "other", from_unreconcile=from_unreconcile
559
+ )
560
+ data += lines
527
561
  return self._recompute_suspense_line(
528
- data
529
- + [
530
- self._get_reconcile_line(
531
- line, "other", from_unreconcile=from_unreconcile
532
- )
533
- for line in other_lines
534
- ],
562
+ data,
535
563
  reconcile_auxiliary_id,
536
564
  self.manual_reference,
537
565
  )
@@ -544,9 +572,9 @@ class AccountBankStatementLine(models.Model):
544
572
  self.ensure_one()
545
573
  self.reconcile_mode = self.journal_id.reconcile_mode
546
574
  result = getattr(self, "_reconcile_bank_line_%s" % self.reconcile_mode)(
547
- self.reconcile_data_info["data"]
575
+ self._prepare_reconcile_line_data(self.reconcile_data_info["data"])
548
576
  )
549
- self.reconcile_data_info = False
577
+ self.reconcile_data = False
550
578
  return result
551
579
 
552
580
  def _reconcile_bank_line_edit(self, data):
@@ -722,10 +750,12 @@ class AccountBankStatementLine(models.Model):
722
750
  if not res:
723
751
  continue
724
752
  liquidity_lines, suspense_lines, other_lines = record._seek_for_lines()
725
- data = [
726
- record._get_reconcile_line(line, "liquidity")
727
- for line in liquidity_lines
728
- ]
753
+ data = []
754
+ for line in liquidity_lines:
755
+ reconcile_auxiliary_id, lines = record._get_reconcile_line(
756
+ line, "liquidity"
757
+ )
758
+ data += lines
729
759
  reconcile_auxiliary_id = 1
730
760
  if res.get("status", "") == "write_off":
731
761
  data = record._recompute_suspense_line(
@@ -733,29 +763,55 @@ class AccountBankStatementLine(models.Model):
733
763
  data, res["model"], reconcile_auxiliary_id
734
764
  ),
735
765
  self.manual_reference,
736
- exchange_recompute=True,
737
766
  )
738
767
  elif res.get("amls"):
739
768
  amount = self.amount
740
769
  for line in res.get("amls", []):
741
- line_data = record._get_reconcile_line(
770
+ reconcile_auxiliary_id, line_datas = record._get_reconcile_line(
742
771
  line, "other", is_counterpart=True, max_amount=amount
743
772
  )
744
- amount -= line_data.get("amount")
745
- data.append(line_data)
773
+ amount -= sum(line_data.get("amount") for line_data in line_datas)
774
+ data += line_datas
746
775
  data = record._recompute_suspense_line(
747
776
  data,
748
777
  reconcile_auxiliary_id,
749
778
  self.manual_reference,
750
- exchange_recompute=True,
751
779
  )
752
780
  if not data.get("can_reconcile"):
753
781
  continue
754
782
  getattr(
755
783
  record, "_reconcile_bank_line_%s" % record.journal_id.reconcile_mode
756
- )(data["data"])
784
+ )(self._prepare_reconcile_line_data(data["data"]))
757
785
  return result
758
786
 
787
+ def _prepare_reconcile_line_data(self, lines):
788
+ new_lines = []
789
+ reverse_lines = {}
790
+ for line in lines:
791
+ if not line.get("id") and not line.get("original_exchange_line_id"):
792
+ new_lines.append(line)
793
+ elif not line.get("original_exchange_line_id"):
794
+ reverse_lines[line["id"]] = line
795
+ for line in lines:
796
+ if line.get("original_exchange_line_id"):
797
+ reverse_lines[line["original_exchange_line_id"]].update(
798
+ {
799
+ "amount": reverse_lines[line["original_exchange_line_id"]][
800
+ "amount"
801
+ ]
802
+ + line["amount"],
803
+ "credit": reverse_lines[line["original_exchange_line_id"]][
804
+ "credit"
805
+ ]
806
+ + line["credit"],
807
+ "debit": reverse_lines[line["original_exchange_line_id"]][
808
+ "debit"
809
+ ]
810
+ + line["debit"],
811
+ }
812
+ )
813
+ return new_lines + list(reverse_lines.values())
814
+
759
815
  def button_manual_reference_full_paid(self):
760
816
  self.ensure_one()
761
817
  if not self.reconcile_data_info["manual_reference"]:
@@ -768,14 +824,14 @@ class AccountBankStatementLine(models.Model):
768
824
  if line["reference"] == manual_reference and line.get("id"):
769
825
  total_amount = -line["amount"] + line["original_amount_unsigned"]
770
826
  original_amount = line["original_amount_unsigned"]
771
- new_data.append(
772
- self._get_reconcile_line(
773
- self.env["account.move.line"].browse(line["id"]),
774
- "other",
775
- is_counterpart=True,
776
- max_amount=original_amount,
777
- )
827
+ reconcile_auxiliary_id, lines = self._get_reconcile_line(
828
+ self.env["account.move.line"].browse(line["id"]),
829
+ "other",
830
+ is_counterpart=True,
831
+ reconcile_auxiliary_id=reconcile_auxiliary_id,
832
+ max_amount=original_amount,
778
833
  )
834
+ new_data += lines
779
835
  new_data.append(
780
836
  {
781
837
  "reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
@@ -800,7 +856,6 @@ class AccountBankStatementLine(models.Model):
800
856
  new_data,
801
857
  reconcile_auxiliary_id,
802
858
  self.manual_reference,
803
- exchange_recompute=True,
804
859
  )
805
860
  self.can_reconcile = self.reconcile_data_info.get("can_reconcile", False)
806
861
 
@@ -815,18 +870,86 @@ class AccountBankStatementLine(models.Model):
815
870
  self.move_id.to_check = False
816
871
 
817
872
  def _get_reconcile_line(
818
- self, line, kind, is_counterpart=False, max_amount=False, from_unreconcile=False
873
+ self,
874
+ line,
875
+ kind,
876
+ is_counterpart=False,
877
+ max_amount=False,
878
+ from_unreconcile=False,
879
+ reconcile_auxiliary_id=False,
819
880
  ):
820
- vals = super()._get_reconcile_line(
881
+ new_vals = super()._get_reconcile_line(
821
882
  line,
822
883
  kind,
823
884
  is_counterpart=is_counterpart,
824
885
  max_amount=max_amount,
825
886
  from_unreconcile=from_unreconcile,
826
887
  )
827
- if vals["partner_id"] is False and self.partner_name:
828
- vals["partner_id"] = (False, self.partner_name)
829
- return vals
888
+ rates = []
889
+ for vals in new_vals:
890
+ if vals["partner_id"] is False:
891
+ vals["partner_id"] = (False, self.partner_name)
892
+ reconcile_auxiliary_id, rate = self._compute_exchange_rate(
893
+ vals, line, reconcile_auxiliary_id
894
+ )
895
+ if rate:
896
+ rates.append(rate)
897
+ new_vals += rates
898
+ return reconcile_auxiliary_id, new_vals
899
+
900
+ def _get_exchange_rate_amount(self, amount, currency_amount, currency, line):
901
+ return (
902
+ currency._convert(
903
+ currency_amount,
904
+ self.company_id.currency_id,
905
+ self.company_id,
906
+ self.date,
907
+ )
908
+ - amount
909
+ )
910
+
911
+ def _compute_exchange_rate(
912
+ self,
913
+ vals,
914
+ line,
915
+ reconcile_auxiliary_id,
916
+ ):
917
+ foreign_currency = (
918
+ self.currency_id != self.company_id.currency_id
919
+ or self.foreign_currency_id
920
+ or vals["currency_id"] != vals["line_currency_id"]
921
+ )
922
+ if not foreign_currency or self.is_reconciled:
923
+ return reconcile_auxiliary_id, False
924
+ currency = self.env["res.currency"].browse(vals["line_currency_id"])
925
+ amount = self._get_exchange_rate_amount(
926
+ vals.get("amount", 0), vals.get("currency_amount", 0), currency, line
927
+ )
928
+ if currency.is_zero(amount):
929
+ return reconcile_auxiliary_id, False
930
+ account = self.company_id.expense_currency_exchange_account_id
931
+ if amount < 0:
932
+ account = self.company_id.income_currency_exchange_account_id
933
+ data = {
934
+ "is_exchange_counterpart": True,
935
+ "original_exchange_line_id": line.id,
936
+ "reference": "reconcile_auxiliary;%s" % reconcile_auxiliary_id,
937
+ "id": False,
938
+ "account_id": account.name_get()[0],
939
+ "partner_id": False,
940
+ "date": fields.Date.to_string(self.date),
941
+ "name": self.payment_ref or self.name,
942
+ "amount": amount,
943
+ "net_amount": amount,
944
+ "credit": -amount if amount < 0 else 0.0,
945
+ "debit": amount if amount > 0 else 0.0,
946
+ "kind": "other",
947
+ "currency_id": self.company_id.currency_id.id,
948
+ "line_currency_id": self.company_id.currency_id.id,
949
+ "currency_amount": amount,
950
+ }
951
+ reconcile_auxiliary_id += 1
952
+ return reconcile_auxiliary_id, data
830
953
 
831
954
  def add_statement(self):
832
955
  self.ensure_one()
@@ -38,33 +38,30 @@ class AccountReconcileAbstract(models.AbstractModel):
38
38
  ):
39
39
  date = self.date if "date" in self._fields else line.date
40
40
  original_amount = amount = net_amount = line.debit - line.credit
41
- amount_currency = self.company_id.currency_id
42
41
  if is_counterpart:
43
- amount = line.amount_residual_currency or line.amount_residual
44
- amount_currency = line.currency_id or self.company_id.currency_id
45
- original_amount = net_amount = line.amount_residual
42
+ currency_amount = -line.amount_residual_currency or line.amount_residual
43
+ amount = -line.amount_residual
44
+ currency = line.currency_id or self.company_id.currency_id
45
+ original_amount = net_amount = -line.amount_residual
46
46
  if max_amount:
47
47
  currency_max_amount = self.company_id.currency_id._convert(
48
- max_amount, amount_currency, self.company_id, line.date
48
+ max_amount, currency, self.company_id, date
49
49
  )
50
- if amount > currency_max_amount > 0:
50
+ if (
51
+ -currency_amount > currency_max_amount > 0
52
+ or -currency_amount < currency_max_amount < 0
53
+ ):
51
54
  amount = currency_max_amount
52
- net_amount = max_amount
53
- if amount < currency_max_amount < 0:
54
- amount = currency_max_amount
55
- net_amount = max_amount
56
- amount = -amount
57
- original_amount = -original_amount
58
- net_amount = -net_amount
55
+ net_amount = -max_amount
56
+ currency_amount = -amount
57
+ amount = currency._convert(
58
+ currency_amount,
59
+ self.company_id.currency_id,
60
+ self.company_id,
61
+ date,
62
+ )
59
63
  else:
60
- amount_currency = line.currency_id
61
- amount = self.company_id.currency_id._convert(
62
- amount, amount_currency, self.company_id, date
63
- )
64
- currency_amount = amount
65
- amount = amount_currency._convert(
66
- amount, self.company_id.currency_id, self.company_id, date
67
- )
64
+ currency_amount = line.amount_currency
68
65
  vals = {
69
66
  "reference": "account.move.line;%s" % line.id,
70
67
  "id": line.id,
@@ -101,4 +98,4 @@ class AccountReconcileAbstract(models.AbstractModel):
101
98
  vals["original_amount_unsigned"] = original_amount
102
99
  if is_counterpart:
103
100
  vals["counterpart_line_ids"] = line.ids
104
- return vals
101
+ return [vals]
@@ -367,7 +367,7 @@ ul.auto-toc {
367
367
  !! This file is generated by oca-gen-addon-readme !!
368
368
  !! changes will be overwritten. !!
369
369
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:223a415f11a6e89566fdec656377f5e439236dc333a3207f5a3290d8699bf39c
370
+ !! source digest: sha256:88b6b066ad75c60faa27b6558ead2c5bf920b1e5f1baf6e5b1414a4361cd5d63
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
372
  <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&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
373
  <p>This addon allows to reconcile bank statements and account marked as
@@ -32,6 +32,7 @@ export class AccountReconcileDataWidget extends Component {
32
32
  });
33
33
  data[line].amount_currency_format = formatMonetary(
34
34
  data[line].currency_amount,
35
+ undefined,
35
36
  {
36
37
  currencyId: data[line].line_currency_id,
37
38
  }
@@ -51,6 +52,7 @@ export class AccountReconcileDataWidget extends Component {
51
52
  return data;
52
53
  }
53
54
  onTrashLine(ev, line) {
55
+ ev.stopPropagation();
54
56
  this.props.record.update({
55
57
  manual_reference: line.reference,
56
58
  manual_delete: true,