Skip to content

Commit

Permalink
Merge pull request #558 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/account-reconcile (16.0)
  • Loading branch information
bt-admin authored Mar 13, 2024
2 parents ded9624 + 427bd8a commit 9808e78
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ addon | version | maintainers | summary
[account_move_base_import](account_move_base_import/) | 16.0.1.0.1 | | Journal Entry base import
[account_move_line_reconcile_manual](account_move_line_reconcile_manual/) | 16.0.2.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Manually reconcile Journal Items
[account_move_reconcile_forbid_cancel](account_move_reconcile_forbid_cancel/) | 16.0.1.0.1 | | Account Move Reconcile Forbid Cancel
[account_reconcile_oca](account_reconcile_oca/) | 16.0.1.2.8 | [![etobella](https://github.com/etobella.png?size=30px)](https://github.com/etobella) | Reconcile addons for Odoo CE accounting
[account_reconcile_oca](account_reconcile_oca/) | 16.0.1.2.9 | [![etobella](https://github.com/etobella.png?size=30px)](https://github.com/etobella) | Reconcile addons for Odoo CE accounting
[account_statement_base](account_statement_base/) | 16.0.1.3.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Base module for Bank Statements
[base_transaction_id](base_transaction_id/) | 16.0.1.0.0 | | Base transaction ID for financial institutes

Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Reconcile Oca
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9ca8a9083b94960f64b749a4c0fe19862f58e9c89641b9e44ddb00144bf8234d
!! source digest: sha256:41bfe5e8981ad915aa3914a1e1f8f870c70c82e2805bcc259bd27a75e90c4119
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Account Reconcile Oca",
"summary": """
Reconcile addons for Odoo CE accounting""",
"version": "16.0.1.2.8",
"version": "16.0.1.2.9",
"license": "AGPL-3",
"author": "CreuBlanca,Dixmit,Odoo Community Association (OCA)",
"maintainers": ["etobella"],
Expand Down
35 changes: 27 additions & 8 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,16 @@ def _onchange_add_account_move_line_id(self):
new_data,
self.reconcile_data_info["reconcile_auxiliary_id"],
self.manual_reference,
exchange_recompute=True,
)
self.can_reconcile = self.reconcile_data_info.get("can_reconcile", False)
self.add_account_move_line_id = False

def _recompute_suspense_line(self, data, reconcile_auxiliary_id, manual_reference):
def _recompute_suspense_line(
self, data, reconcile_auxiliary_id, manual_reference, exchange_recompute=False
):
reconcile_auxiliary_id = self._compute_exchange_rate(
data, reconcile_auxiliary_id
data, reconcile_auxiliary_id, exchange_recompute=exchange_recompute
)
can_reconcile = True
total_amount = 0
Expand Down Expand Up @@ -393,7 +396,11 @@ def _reconcile_data_by_model(self, data, reconcile_model, reconcile_auxiliary_id
new_data.append(new_line)
return new_data, reconcile_auxiliary_id

def _compute_exchange_rate(self, data, reconcile_auxiliary_id):
def _compute_exchange_rate(
self, data, reconcile_auxiliary_id, exchange_recompute=False
):
if not exchange_recompute:
return reconcile_auxiliary_id
foreign_currency = (
self.currency_id != self.company_id.currency_id
or self.foreign_currency_id
Expand All @@ -416,6 +423,7 @@ def _compute_exchange_rate(self, data, reconcile_auxiliary_id):
"date": fields.Date.to_string(self.date),
"name": self.payment_ref or self.name,
"amount": -amount,
"net_amount": -amount,
"credit": amount if amount > 0 else 0.0,
"debit": -amount if amount < 0 else 0.0,
"kind": "other",
Expand Down Expand Up @@ -444,7 +452,8 @@ def _default_reconcile_data(self, from_unreconcile=False):
*self._reconcile_data_by_model(
data, res["model"], reconcile_auxiliary_id
),
self.manual_reference
self.manual_reference,
exchange_recompute=True
)
elif res and res.get("amls"):
amount = self.amount_total_signed
Expand All @@ -455,7 +464,10 @@ def _default_reconcile_data(self, from_unreconcile=False):
amount -= line_data.get("amount")
data.append(line_data)
return self._recompute_suspense_line(
data, reconcile_auxiliary_id, self.manual_reference
data,
reconcile_auxiliary_id,
self.manual_reference,
exchange_recompute=True,
)
return self._recompute_suspense_line(
data
Expand Down Expand Up @@ -643,7 +655,8 @@ def create(self, mvals):
*record._reconcile_data_by_model(
data, res["model"], reconcile_auxiliary_id
),
self.manual_reference
self.manual_reference,
exchange_recompute=True
)
elif res.get("amls"):
amount = self.amount
Expand All @@ -654,7 +667,10 @@ def create(self, mvals):
amount -= line_data.get("amount")
data.append(line_data)
data = record._recompute_suspense_line(
data, reconcile_auxiliary_id, self.manual_reference
data,
reconcile_auxiliary_id,
self.manual_reference,
exchange_recompute=True,
)
if not data.get("can_reconcile"):
continue
Expand Down Expand Up @@ -704,7 +720,10 @@ def button_manual_reference_full_paid(self):
else:
new_data.append(line)
self.reconcile_data_info = self._recompute_suspense_line(
new_data, reconcile_auxiliary_id, self.manual_reference
new_data,
reconcile_auxiliary_id,
self.manual_reference,
exchange_recompute=True,
)
self.can_reconcile = self.reconcile_data_info.get("can_reconcile", False)

Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">Account Reconcile Oca</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9ca8a9083b94960f64b749a4c0fe19862f58e9c89641b9e44ddb00144bf8234d
!! source digest: sha256:41bfe5e8981ad915aa3914a1e1f8f870c70c82e2805bcc259bd27a75e90c4119
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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>
<p>This addon allows to reconcile bank statements and account marked as <cite>reconcile</cite>.</p>
Expand Down

0 comments on commit 9808e78

Please sign in to comment.