Skip to content

Commit

Permalink
Merge pull request #482 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 Sep 18, 2023
2 parents e6aefbe + 28d4671 commit cfef9c4
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 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.1.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.0 | | Account Move Reconcile Forbid Cancel
[account_reconcile_oca](account_reconcile_oca/) | 16.0.1.2.2 | [![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.3 | [![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:fb0fd744eefd0185149b04302d378a12ae62c7db864b2230c6d71149eda92e79
!! source digest: sha256:a5602a236b00b98e0482db2b8d8b7a457ff584713a4d953ec4f867ddf900276a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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.2",
"version": "16.0.1.2.3",
"license": "AGPL-3",
"author": "CreuBlanca,Odoo Community Association (OCA)",
"maintainers": ["etobella"],
Expand Down
6 changes: 3 additions & 3 deletions account_reconcile_oca/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ def _reconcile_data_by_model(self, data, reconcile_model, reconcile_auxiliary_id
continue
new_data.append(line_data)
liquidity_amount += line_data["amount"]
for line in reconcile_model._apply_lines_for_bank_widget(
-liquidity_amount, self._retrieve_partner(), self
for line in reconcile_model._get_write_off_move_lines_dict(
-liquidity_amount, self._retrieve_partner()
):
new_line = line.copy()
amount = line.get("amount_currency")
amount = line.get("balance")
if self.foreign_currency_id:
amount = self.foreign_currency_id.compute(
amount, self.journal_id.currency_id or self.company_currency_id
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 @@ -367,7 +367,7 @@ <h1 class="title">Account Reconcile Oca</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fb0fd744eefd0185149b04302d378a12ae62c7db864b2230c6d71149eda92e79
!! source digest: sha256:a5602a236b00b98e0482db2b8d8b7a457ff584713a4d953ec4f867ddf900276a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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
54 changes: 54 additions & 0 deletions account_reconcile_oca/tests/test_bank_account_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def setUpClass(cls, chart_template_ref=None):
"line_ids": [(0, 0, {"account_id": cls.current_assets_account.id})],
}
)
cls.tax_10 = cls.env["account.tax"].create(
{
"name": "tax_10",
"amount_type": "percent",
"amount": 10.0,
}
)
# We need to make some fields visible in order to make the tests work
cls.env["ir.ui.view"].create(
{
Expand Down Expand Up @@ -348,12 +355,59 @@ def test_reconcile_model(self):
f.manual_model_id = self.rule
self.assertTrue(f.can_reconcile)
bank_stmt_line.reconcile_bank_line()
self.assertEqual(2, len(bank_stmt_line.move_id.line_ids))
self.assertTrue(
bank_stmt_line.move_id.line_ids.filtered(
lambda r: r.account_id == self.current_assets_account
)
)

def test_reconcile_model_tax_included(self):
"""
We want to test what happens when we select an reconcile model to fill a
bank statement.
"""
self.rule.line_ids.write(
{"tax_ids": [(4, self.tax_10.id)], "force_tax_included": True}
)
bank_stmt = self.acc_bank_stmt_model.create(
{
"company_id": self.env.ref("base.main_company").id,
"journal_id": self.bank_journal_euro.id,
"date": time.strftime("%Y-07-15"),
"name": "test",
}
)
bank_stmt_line = self.acc_bank_stmt_line_model.create(
{
"name": "testLine",
"journal_id": self.bank_journal_euro.id,
"statement_id": bank_stmt.id,
"amount": 100,
"date": time.strftime("%Y-07-15"),
}
)
with Form(
bank_stmt_line,
view="account_reconcile_oca.bank_statement_line_form_reconcile_view",
) as f:
self.assertFalse(f.can_reconcile)
f.manual_model_id = self.rule
self.assertTrue(f.can_reconcile)
bank_stmt_line.reconcile_bank_line()
self.assertEqual(3, len(bank_stmt_line.move_id.line_ids))
self.assertTrue(
bank_stmt_line.move_id.line_ids.filtered(
lambda r: r.account_id == self.current_assets_account
and r.tax_ids == self.tax_10
)
)
self.assertTrue(
bank_stmt_line.move_id.line_ids.filtered(
lambda r: r.tax_line_id == self.tax_10
)
)

def test_reconcile_invoice_model(self):
"""
We want to test what happens when we select a reconcile model to fill a
Expand Down

0 comments on commit cfef9c4

Please sign in to comment.