diff --git a/report_substitute/README.rst b/report_substitute/README.rst
index 7d7560de35..196cfb7f05 100644
--- a/report_substitute/README.rst
+++ b/report_substitute/README.rst
@@ -17,13 +17,13 @@ Report Substitute
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
- :target: https://github.com/OCA/reporting-engine/tree/16.0/report_substitute
+ :target: https://github.com/OCA/reporting-engine/tree/15.0/report_substitute
:alt: OCA/reporting-engine
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_substitute
+ :target: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_substitute
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=15.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -68,7 +68,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -106,6 +106,6 @@ Current `maintainer `__:
|maintainer-sbejaoui|
-This module is part of the `OCA/reporting-engine `_ project on GitHub.
+This module is part of the `OCA/reporting-engine `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/report_substitute/__manifest__.py b/report_substitute/__manifest__.py
index 4121659ac9..9338dcefc1 100644
--- a/report_substitute/__manifest__.py
+++ b/report_substitute/__manifest__.py
@@ -6,7 +6,7 @@
"summary": """
This module allows to create substitution rules for report actions.
""",
- "version": "16.0.1.0.2",
+ "version": "15.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
diff --git a/report_substitute/demo/action_report.xml b/report_substitute/demo/action_report.xml
index 562f511fdd..952708c44b 100644
--- a/report_substitute/demo/action_report.xml
+++ b/report_substitute/demo/action_report.xml
@@ -1,7 +1,13 @@
- Substitution Report
+
+
+
+ Substitution Report
+
+
+
Substitution For Technical guide
@@ -19,7 +25,13 @@
/>
- Substitution Report 2
+
+
+
+ Substitution Report 2
+
+
+
Substitution 2 For Technical guide
diff --git a/report_substitute/models/ir_actions_report.py b/report_substitute/models/ir_actions_report.py
index 47ea0a3b13..65a670180b 100644
--- a/report_substitute/models/ir_actions_report.py
+++ b/report_substitute/models/ir_actions_report.py
@@ -50,18 +50,14 @@ def get_substitution_report_action(self, action, active_ids):
return action
- def _render(self, report_ref, res_ids, data=None):
- report = self._get_report(report_ref)
- substitution_report = report.get_substitution_report(res_ids)
- return super(IrActionReport, self)._render(
- substitution_report.report_name, res_ids, data=data
- )
+ def _render(self, res_ids, data=None):
+ substitution_report = self.get_substitution_report(res_ids)
+ return super(IrActionReport, substitution_report)._render(res_ids, data)
- def _render_qweb_pdf(self, report_ref, res_ids=None, data=None):
- report = self._get_report(report_ref)
- substitution_report = report.get_substitution_report(res_ids)
- return super(IrActionReport, self)._render_qweb_pdf(
- substitution_report, res_ids=res_ids, data=data
+ def _render_qweb_pdf(self, res_ids=None, data=None):
+ substitution_report = self.get_substitution_report(res_ids)
+ return super(IrActionReport, substitution_report)._render_qweb_pdf(
+ res_ids=res_ids, data=data
)
def report_action(self, docids, data=None, config=True):
diff --git a/report_substitute/static/description/index.html b/report_substitute/static/description/index.html
index 9e25d5956e..fafd16412b 100644
--- a/report_substitute/static/description/index.html
+++ b/report_substitute/static/description/index.html
@@ -8,11 +8,10 @@
/*
:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
+:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z 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.
@@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }
-pre.code .ln { color: gray; } /* line numbers */
+pre.code .ln { color: grey; } /* 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 }
@@ -301,7 +300,7 @@
span.pre {
white-space: pre }
-span.problematic, pre.problematic {
+span.problematic {
color: red }
span.section-subtitle {
@@ -369,7 +368,7 @@ Report Substitute
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c8dc45c73e2d23ef5504e4ffbae69fe4c62e4e64f8a8b6ef11b13adbb7a7ebb6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module allows you to create substitution rules for report actions.
A typical use case is to replace a standard report by alternative reports
when some conditions are met. For instance, it allows to configure alternate
@@ -412,7 +411,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -432,15 +431,13 @@
This module is maintained by the OCA.
-
-
-
+
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.
Current maintainer:
-
This module is part of the OCA/reporting-engine project on GitHub.
+
This module is part of the OCA/reporting-engine project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/report_substitute/tests/test_report_substitute.py b/report_substitute/tests/test_report_substitute.py
index 88796624de..0a07fd8646 100644
--- a/report_substitute/tests/test_report_substitute.py
+++ b/report_substitute/tests/test_report_substitute.py
@@ -20,27 +20,15 @@ def setUp(self):
).id
def test_substitution(self):
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertIn('Substitution Report
', res)
# remove the substation rule
self.substitution_rule.unlink()
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertNotIn('Substitution Report
', res)
def test_recursive_substitution(self):
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertNotIn('Substitution Report 2
', res)
self.env["ir.actions.report.substitution.rule"].create(
{
@@ -52,27 +40,15 @@ def test_recursive_substitution(self):
).id,
}
)
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertIn('Substitution Report 2
', res)
def test_substitution_with_domain(self):
self.substitution_rule.write({"domain": "[('name', '=', 'base')]"})
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertIn('Substitution Report
', res)
self.substitution_rule.write({"domain": "[('name', '!=', 'base')]"})
- res = str(
- self.action_report._render(
- self.action_report.report_name, res_ids=self.res_ids
- )[0]
- )
+ res = str(self.action_report._render(res_ids=self.res_ids)[0])
self.assertNotIn('Substitution Report
', res)
def test_substitution_with_action_dict(self):
diff --git a/setup/report_substitute/odoo/addons/report_substitute b/setup/report_substitute/odoo/addons/report_substitute
new file mode 120000
index 0000000000..b85da0bad6
--- /dev/null
+++ b/setup/report_substitute/odoo/addons/report_substitute
@@ -0,0 +1 @@
+../../../../report_substitute
\ No newline at end of file
diff --git a/setup/report_substitute/setup.py b/setup/report_substitute/setup.py
new file mode 100644
index 0000000000..28c57bb640
--- /dev/null
+++ b/setup/report_substitute/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)