Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ addon | version | maintainers | summary
[attachment_queue](attachment_queue/) | 18.0.1.0.0 | <a href='https://github.com/florian-dacosta'><img src='https://github.com/florian-dacosta.png' width='32' height='32' style='border-radius:50%;' alt='florian-dacosta'/></a> <a href='https://github.com/sebastienbeau'><img src='https://github.com/sebastienbeau.png' width='32' height='32' style='border-radius:50%;' alt='sebastienbeau'/></a> | Base module adding the concept of queue for processing files
[attachment_synchronize](attachment_synchronize/) | 18.0.1.0.0 | <a href='https://github.com/florian-dacosta'><img src='https://github.com/florian-dacosta.png' width='32' height='32' style='border-radius:50%;' alt='florian-dacosta'/></a> <a href='https://github.com/sebastienbeau'><img src='https://github.com/sebastienbeau.png' width='32' height='32' style='border-radius:50%;' alt='sebastienbeau'/></a> <a href='https://github.com/GSLabIt'><img src='https://github.com/GSLabIt.png' width='32' height='32' style='border-radius:50%;' alt='GSLabIt'/></a> <a href='https://github.com/bealdav'><img src='https://github.com/bealdav.png' width='32' height='32' style='border-radius:50%;' alt='bealdav'/></a> | Attachment Synchronize
[attachment_unindex_content](attachment_unindex_content/) | 18.0.1.0.0 | <a href='https://github.com/moylop260'><img src='https://github.com/moylop260.png' width='32' height='32' style='border-radius:50%;' alt='moylop260'/></a> <a href='https://github.com/ebirbe'><img src='https://github.com/ebirbe.png' width='32' height='32' style='border-radius:50%;' alt='ebirbe'/></a> <a href='https://github.com/luisg123v'><img src='https://github.com/luisg123v.png' width='32' height='32' style='border-radius:50%;' alt='luisg123v'/></a> | Disable indexing of attachments
[auditlog](auditlog/) | 18.0.2.0.4 | | Audit Log
[auditlog](auditlog/) | 18.0.2.0.5 | | Audit Log
[auto_backup](auto_backup/) | 18.0.1.0.1 | | Backups database
[autovacuum_message_attachment](autovacuum_message_attachment/) | 18.0.1.0.1 | <a href='https://github.com/florian-dacosta'><img src='https://github.com/florian-dacosta.png' width='32' height='32' style='border-radius:50%;' alt='florian-dacosta'/></a> | Automatically delete old mail messages and attachments
[base_cron_exclusion](base_cron_exclusion/) | 18.0.1.0.1 | <a href='https://github.com/LoisRForgeFlow'><img src='https://github.com/LoisRForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='LoisRForgeFlow'/></a> <a href='https://github.com/ChrisOForgeFlow'><img src='https://github.com/ChrisOForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='ChrisOForgeFlow'/></a> | Allow you to select scheduled actions that should not run simultaneously.
Expand Down Expand Up @@ -63,7 +63,7 @@ addon | version | maintainers | summary
[scheduler_error_mailer](scheduler_error_mailer/) | 18.0.1.0.0 | | Scheduler Error Mailer
[sentry](sentry/) | 18.0.1.0.3 | <a href='https://github.com/barsi'><img src='https://github.com/barsi.png' width='32' height='32' style='border-radius:50%;' alt='barsi'/></a> <a href='https://github.com/naglis'><img src='https://github.com/naglis.png' width='32' height='32' style='border-radius:50%;' alt='naglis'/></a> <a href='https://github.com/versada'><img src='https://github.com/versada.png' width='32' height='32' style='border-radius:50%;' alt='versada'/></a> <a href='https://github.com/moylop260'><img src='https://github.com/moylop260.png' width='32' height='32' style='border-radius:50%;' alt='moylop260'/></a> <a href='https://github.com/fernandahf'><img src='https://github.com/fernandahf.png' width='32' height='32' style='border-radius:50%;' alt='fernandahf'/></a> | Report Odoo errors to Sentry
[session_db](session_db/) | 18.0.1.0.1 | <a href='https://github.com/sbidoul'><img src='https://github.com/sbidoul.png' width='32' height='32' style='border-radius:50%;' alt='sbidoul'/></a> | Store sessions in DB
[test_auditlog](test_auditlog/) | 18.0.1.0.2 | | Additional unit tests for Audit Log based on accounting models
[test_auditlog](test_auditlog/) | 18.0.1.0.3 | | Additional unit tests for Audit Log based on accounting models
[test_base_time_window](test_base_time_window/) | 18.0.1.0.0 | | Test Base model to handle time windows
[tracking_manager](tracking_manager/) | 18.0.1.1.0 | <a href='https://github.com/Kev-Roche'><img src='https://github.com/Kev-Roche.png' width='32' height='32' style='border-radius:50%;' alt='Kev-Roche'/></a> <a href='https://github.com/sebastienbeau'><img src='https://github.com/sebastienbeau.png' width='32' height='32' style='border-radius:50%;' alt='sebastienbeau'/></a> | This module tracks all fields of a model, including one2many and many2many ones.
[tracking_manager_domain](tracking_manager_domain/) | 18.0.1.0.1 | <a href='https://github.com/CRogos'><img src='https://github.com/CRogos.png' width='32' height='32' style='border-radius:50%;' alt='CRogos'/></a> | This module extends the tracking manager to allow to define a domain on fields to track changes only when certain conditions apply.
Expand Down
2 changes: 1 addition & 1 deletion auditlog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Audit Log
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:128a623839f266a13080072b8ee934467414cee354aff1afe25f078729621f52
!! source digest: sha256:5d80401c7f72e7744b093dc1e4ee6fc2eec010879861d75c844494808dc0e867
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion auditlog/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Audit Log",
"version": "18.0.2.0.4",
"version": "18.0.2.0.5",
"author": "ABF OSIELL, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-tools",
Expand Down
10 changes: 6 additions & 4 deletions auditlog/models/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ def __enter__(self):
don't swap them all out here.
"""
self._original_cache = self._transaction.cache
# Copy the sets of records, which are popped on recompute but do not
# copy the keys because they do not match the original field object
# afterwards.
self._original_tocompute = defaultdict(OrderedSet)
# Also swap out the list of fields to recompute. Their compute methods
# may depend on fields in the cache that are not yet flushed, and as is
# the case with account.bank.statement.line's _compute_internal_index,
# may not be resilient to some of the values (c.q. 'date') missing.
self._original_tocompute = self._transaction.tocompute
self._transaction.tocompute = defaultdict(OrderedSet)
for key, value in self._transaction.tocompute.items():
self._original_tocompute[key] = OrderedSet(value)
temporary_cache = api.Cache()
Expand Down
2 changes: 1 addition & 1 deletion auditlog/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Audit Log</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:128a623839f266a13080072b8ee934467414cee354aff1afe25f078729621f52
!! source digest: sha256:5d80401c7f72e7744b093dc1e4ee6fc2eec010879861d75c844494808dc0e867
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/auditlog"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-auditlog"><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/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows the administrator to log user operations performed on
Expand Down
2 changes: 1 addition & 1 deletion test_auditlog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Audit Log Tests
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b0537bd80eb5a3d24aef4fd1cb72d66f7b384ba71861dbec738aa6695abbc539
!! source digest: sha256:ae0a5ae9d572925bd0b2083f4d0a20734e00d384183a843b0c04ccc202deb904
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion test_auditlog/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Audit Log Tests",
"summary": "Additional unit tests for Audit Log based on accounting models",
"version": "18.0.1.0.2",
"version": "18.0.1.0.3",
"author": "Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-tools",
Expand Down
2 changes: 1 addition & 1 deletion test_auditlog/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Audit Log Tests</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b0537bd80eb5a3d24aef4fd1cb72d66f7b384ba71861dbec738aa6695abbc539
!! source digest: sha256:ae0a5ae9d572925bd0b2083f4d0a20734e00d384183a843b0c04ccc202deb904
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/18.0/test_auditlog"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-test_auditlog"><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/server-tools&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module does not add any business or technical functionality. It
Expand Down
1 change: 1 addition & 0 deletions test_auditlog/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import test_account_bank_statement_line
from . import test_account_move_reverse
from . import test_product_tax_multicompany
52 changes: 52 additions & 0 deletions test_auditlog/tests/test_account_bank_statement_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from odoo.tests import tagged

from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.addons.auditlog.tests.common import AuditLogRuleCommon


@tagged("post_install", "-at_install")
class TestAccountBankStatementLine(AccountTestInvoicingCommon, AuditLogRuleCommon):
def setUp(self):
super().setUp()
self.rule = self.env["auditlog.rule"].create(
{
"name": __name__,
"model_id": self.env.ref("account.model_account_move").id,
"log_read": True,
"log_create": True,
"log_write": True,
"log_unlink": True,
"log_type": "full",
}
)
self.rule.subscribe()

def test_create_statement_line(self):
"""Statement line can be created with logging on journal entries enabled.

Because we swap out the cache when fetching previous values during full
logging using the ThrowAwayCache, some values that are assumed by
compute methods (c.q. 'date' in account.bank.statement.line's
_compute_internal_index) might be missing. If a recompute of those fields
is inadvertently triggered when using the ThrowAwayCache, the missing
values will raise an exception (in this case: `AttributeError: 'bool'
object has no attribute 'strftime'`). This test verifies that the queued
recomputes are consistent with the values in the cache such that this
exception does not occur.
"""
partner = self.env["res.partner"].create({"name": "test"})
stmt = self.env["account.bank.statement"].create(
{"journal_id": self.company_data["default_journal_bank"].id}
)
line = self.env["account.bank.statement.line"].create(
{
"date": "2023-04-01",
"account_number": "NL45 TRIO 0198100000",
"amount": 5.75,
"journal_id": self.company_data["default_journal_bank"].id,
"payment_ref": "1234",
"partner_id": partner.id,
"statement_id": stmt.id,
},
)
line.flush_recordset()