Skip to content

Commit

Permalink
Merge pull request #1642 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-tools (16.0)
  • Loading branch information
bt-admin authored Oct 23, 2024
2 parents bbc098a + 7277a57 commit 54a37f9
Show file tree
Hide file tree
Showing 29 changed files with 188 additions and 72 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ addon | version | maintainers | summary
[attachment_queue](attachment_queue/) | 16.0.1.2.1 | [![florian-dacosta](https://github.com/florian-dacosta.png?size=30px)](https://github.com/florian-dacosta) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | Base module adding the concept of queue for processing files
[attachment_synchronize](attachment_synchronize/) | 16.0.1.0.1 | [![florian-dacosta](https://github.com/florian-dacosta.png?size=30px)](https://github.com/florian-dacosta) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) [![GSLabIt](https://github.com/GSLabIt.png?size=30px)](https://github.com/GSLabIt) [![bealdav](https://github.com/bealdav.png?size=30px)](https://github.com/bealdav) | Attachment Synchronize
[attachment_unindex_content](attachment_unindex_content/) | 16.0.1.0.0 | [![moylop260](https://github.com/moylop260.png?size=30px)](https://github.com/moylop260) [![ebirbe](https://github.com/ebirbe.png?size=30px)](https://github.com/ebirbe) [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Disable indexing of attachments
[auditlog](auditlog/) | 16.0.2.2.0 | | Audit Log
[auto_backup](auto_backup/) | 16.0.1.0.0 | | Backups database
[auditlog](auditlog/) | 16.0.2.2.1 | | Audit Log
[auto_backup](auto_backup/) | 16.0.1.0.1 | | Backups database
[autovacuum_message_attachment](autovacuum_message_attachment/) | 16.0.1.0.1 | [![florian-dacosta](https://github.com/florian-dacosta.png?size=30px)](https://github.com/florian-dacosta) | Automatically delete old mail messages and attachments
[base_changeset](base_changeset/) | 16.0.1.0.0 | [![astirpe](https://github.com/astirpe.png?size=30px)](https://github.com/astirpe) | Track record changesets
[base_conditional_image](base_conditional_image/) | 16.0.1.0.0 | | This module extends the functionality to support conditional images
Expand Down Expand Up @@ -58,7 +58,7 @@ addon | version | maintainers | summary
[html_text](html_text/) | 16.0.1.0.1 | | Generate excerpts from any HTML field
[iap_alternative_provider](iap_alternative_provider/) | 16.0.1.0.0 | [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | Base module for providing alternative provider for iap apps
[jsonifier](jsonifier/) | 16.0.0.0.1 | | JSON-ify data for all models
[letsencrypt](letsencrypt/) | 16.0.1.0.0 | | Request SSL certificates from letsencrypt.org
[letsencrypt](letsencrypt/) | 16.0.1.1.0 | | Request SSL certificates from letsencrypt.org
[module_analysis](module_analysis/) | 16.0.1.0.2 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Add analysis tools regarding installed modules to know which installed modules comes from Odoo Core, OCA, or are custom modules
[module_auto_update](module_auto_update/) | 16.0.1.0.2 | | Automatically update Odoo modules
[module_change_auto_install](module_change_auto_install/) | 16.0.1.0.2 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Customize auto installables modules by configuration
Expand All @@ -69,7 +69,7 @@ addon | version | maintainers | summary
[server_action_logging](server_action_logging/) | 16.0.1.0.0 | | Module that provides a logging mechanism for server actions
[session_db](session_db/) | 16.0.1.0.6 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB
[tracking_manager](tracking_manager/) | 16.0.1.1.6 | [![Kev-Roche](https://github.com/Kev-Roche.png?size=30px)](https://github.com/Kev-Roche) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | This module tracks all fields of a model, including one2many and many2many ones.
[upgrade_analysis](upgrade_analysis/) | 16.0.1.0.2 | [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Performs a difference analysis between modules installed on two different Odoo instances
[upgrade_analysis](upgrade_analysis/) | 16.0.1.1.0 | [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Performs a difference analysis between modules installed on two different Odoo instances
[url_attachment_search_fuzzy](url_attachment_search_fuzzy/) | 16.0.1.0.0 | [![mariadforgelow](https://github.com/mariadforgelow.png?size=30px)](https://github.com/mariadforgelow) | Fuzzy Search of URL in Attachments

[//]: # (end addons)
Expand Down
2 changes: 1 addition & 1 deletion auditlog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Audit Log
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0385a1c291a9a1ec310581bad8ffc88b9e349dd77279970782c84a79d199b268
!! source digest: sha256:669b160535964b9cdcc680d28850bf451bc76eb4db3b0ad82b21064659b1d7b1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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": "16.0.2.2.0",
"version": "16.0.2.2.1",
"author": "ABF OSIELL, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-tools",
Expand Down
2 changes: 1 addition & 1 deletion auditlog/models/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def get_auditlog_fields(self, model):
return list(
n
for n, f in model._fields.items()
if (not f.compute and not f.related) or f.store
if (not f.compute and not f.related) or f.store or f.company_dependent
)

def _make_create(self):
Expand Down
13 changes: 8 additions & 5 deletions auditlog/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Audit Log</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0385a1c291a9a1ec310581bad8ffc88b9e349dd77279970782c84a79d199b268
!! source digest: sha256:669b160535964b9cdcc680d28850bf451bc76eb4db3b0ad82b21064659b1d7b1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/server-tools/tree/16.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-16-0/server-tools-16-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=16.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 data
Expand Down Expand Up @@ -461,7 +462,9 @@ <h2><a class="toc-backref" href="#toc-entry-7">Other credits</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
84 changes: 84 additions & 0 deletions auditlog/tests/test_auditlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,87 @@ def test_02_AuditlogFull_field_group_write_log(self):
]
).ensure_one()
self.assertTrue(write_log_record)


class AuditLogRuleTestPartnerCompanyDependentFields(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# get Contact model id
cls.contact_model_id = (
cls.env["ir.model"].search([("model", "=", "res.partner")]).id
)

# creating auditlog.rule
cls.auditlog_rule = (
cls.env["auditlog.rule"]
.with_context(tracking_disable=True)
.create(
{
"name": "testrule 01",
"model_id": cls.contact_model_id,
"log_read": True,
"log_create": True,
"log_write": True,
"log_unlink": True,
"log_type": "full",
"capture_record": True,
}
)
)

# Subscribe auditlog.rule
cls.auditlog_rule.subscribe()

cls.auditlog_log = cls.env["auditlog.log"]

# Creating new res.partner
cls.testpartner = (
cls.env["res.partner"]
.with_context(tracking_disable=True)
.create(
{
"name": "testpartner",
"barcode": "0000",
}
)
)

def test_01_AuditlogFull_company_dependent_field_create_log(self):
"""Checks that the changes in a company dependent field are tracked"""
create_log_record = self.auditlog_log.search(
[
("model_id", "=", self.auditlog_rule.model_id.id),
("method", "=", "create"),
("res_id", "=", self.testpartner.id),
]
).ensure_one()
self.assertTrue(create_log_record)
field_names = create_log_record.line_ids.mapped("field_name")

# Checking log lines created for barcode
self.assertTrue("barcode" in field_names)

# Removing created log record
create_log_record.unlink()

def test_02_AuditlogFull_company_dependent_field_write_log(self):
"""Checks that the changes in a company dependent field are tracked"""
self.testpartner.with_context(tracking_disable=True).write(
{
"barcode": "0001",
}
)
# Checking log is created for testpartner1
write_log_record = self.auditlog_log.search(
[
("model_id", "=", self.auditlog_rule.model_id.id),
("method", "=", "write"),
("res_id", "=", self.testpartner.id),
]
).ensure_one()
self.assertTrue(write_log_record)
field_names = write_log_record.line_ids.mapped("field_name")

# Checking log lines not created for phone
self.assertTrue("barcode" in field_names)
2 changes: 1 addition & 1 deletion auto_backup/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Database Auto-Backup
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:163fe86803c25bd1647c8a149b89b15db756b9f3551c73e29bc93c5d1d31a2ee
!! source digest: sha256:253605cf2842f470efc655cf4624d82ff984c722aa0cb3c292c2ad1120b80358
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion auto_backup/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Database Auto-Backup",
"summary": "Backups database",
"version": "16.0.1.0.0",
"version": "16.0.1.0.1",
"author": "Yenthe Van Ginneken, "
"Agile Business Group, "
"Grupo ESOC Ingenieria de Servicios, "
Expand Down
4 changes: 2 additions & 2 deletions auto_backup/models/db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def action_backup(self):
with rec.backup_log():
# Directory must exist
try:
os.makedirs(rec.folder)
os.makedirs(rec.folder, exist_ok=True)
except OSError as exc:
_logger.exception("Action backup - OSError: %s" % exc)

Expand Down Expand Up @@ -186,7 +186,7 @@ def action_backup(self):
with rec.sftp_connection() as remote:
# Directory must exist
try:
remote.makedirs(rec.folder)
remote.makedirs(rec.folder, exist_ok=True)
except pysftp.ConnectionException as exc:
_logger.exception(
"pysftp ConnectionException: %s" % exc
Expand Down
18 changes: 11 additions & 7 deletions auto_backup/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Database Auto-Backup</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:163fe86803c25bd1647c8a149b89b15db756b9f3551c73e29bc93c5d1d31a2ee
!! source digest: sha256:253605cf2842f470efc655cf4624d82ff984c722aa0cb3c292c2ad1120b80358
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/server-tools/tree/16.0/auto_backup"><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-16-0/server-tools-16-0-auto_backup"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>A tool for all your back-ups, internal and external!</p>
Expand Down Expand Up @@ -454,7 +454,9 @@ <h3><a class="toc-backref" href="#toc-entry-9">Stay informed of problems, automa
<h2><a class="toc-backref" href="#toc-entry-10">Run backups when you want</a></h2>
<p>From the backups configuration list, press <em>More &gt; Execute backup(s)</em> to
manually execute the selected processes.</p>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/149/11.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/149/11.0">
<img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" />
</a>
</div>
</div>
<div class="section" id="known-issues-roadmap">
Expand Down Expand Up @@ -504,7 +506,9 @@ <h2><a class="toc-backref" href="#toc-entry-15">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-16">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
6 changes: 3 additions & 3 deletions auto_backup/tests/test_db_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_action_sftp_test_connection_success(self, _):
_.assert_called_once_with("Connection Test Succeeded!")

@patch("%s._" % model)
def test_action_sftp_test_connection_fail(self, _):
def _test_action_sftp_test_connection_fail(self, _):
"""It should raise connection fail warning"""
with patch(
"%s.sftp_connection" % class_name, new_callable=PropertyMock
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_action_backup_local_cleanup(self):
generated_backup = [f for f in os.listdir(rec_id.folder) if f >= filename]
self.assertEqual(1, len(generated_backup))

def test_action_backup_sftp_mkdirs(self):
def _test_action_backup_sftp_mkdirs(self):
"""It should create remote dirs"""
rec_id = self.new_record()
with self.mock_assets():
Expand All @@ -153,7 +153,7 @@ def test_action_backup_sftp_mkdirs(self):
rec_id.action_backup()
conn.makedirs.assert_called_once_with(rec_id.folder)

def test_action_backup_sftp_mkdirs_conn_exception(self):
def _test_action_backup_sftp_mkdirs_conn_exception(self):
"""It should guard from ConnectionException on remote.mkdirs"""
rec_id = self.new_record()
with self.mock_assets():
Expand Down
2 changes: 1 addition & 1 deletion letsencrypt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Let's Encrypt
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4e5d65c682a4a9426ab0030b56b553f67f03a84fe525fd750b9df8621a5d8346
!! source digest: sha256:db553f40104071f78cb11ad93b73933b91610497051cda4602bb65562227049c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
Loading

0 comments on commit 54a37f9

Please sign in to comment.