diff --git a/base_report_to_printer/README.rst b/base_report_to_printer/README.rst index 1681370..a4697ed 100644 --- a/base_report_to_printer/README.rst +++ b/base_report_to_printer/README.rst @@ -17,23 +17,26 @@ Report to printer :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freport--print--send-lightgray.png?logo=github - :target: https://github.com/OCA/report-print-send/tree/16.0/base_report_to_printer + :target: https://github.com/OCA/report-print-send/tree/17.0/base_report_to_printer :alt: OCA/report-print-send .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/report-print-send-16-0/report-print-send-16-0-base_report_to_printer + :target: https://translation.odoo-community.org/projects/report-print-send-17-0/report-print-send-17-0-base_report_to_printer :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/report-print-send&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module allows users to send reports to a printer attached to the server. +This module allows users to send reports to a printer attached to the +server. -It adds an optional behaviour on reports to send it directly to a printer. +It adds an optional behaviour on reports to send it directly to a +printer. -* `Send to Client` is the default behaviour providing you a downloadable PDF -* `Send to Printer` prints the report on selected printer +- Send to Client is the default behaviour providing you a downloadable + PDF +- Send to Printer prints the report on selected printer It detects trays on printers installation plus permits to select the paper source on which you want to print directly. @@ -48,10 +51,10 @@ preprinted paper such as payment slip. Settings can be configured: -* globally -* per user -* per report -* per user and report +- globally +- per user +- per report +- per user and report **Table of contents** @@ -63,9 +66,9 @@ Installation To install this module, you need to: -#. Install PyCups - https://pypi.python.org/pypi/pycups +1. Install PyCups - https://pypi.python.org/pypi/pycups -.. code-block:: bash +.. code:: bash sudo apt-get install cups sudo apt-get install libcups2-dev @@ -77,47 +80,49 @@ Configuration To configure this module, you need to: -#. Enable the "Printing / Print User" option under access - rights to give users the ability to view the print menu. +1. Enable the "Printing / Print User" option under access rights to give + users the ability to view the print menu. - -The jobs will be sent to the printer with a name matching the print_report_name -of the report (truncated at 80 characters). By default this will not be -displayed by CUPS web interface or in Odoo. To see this information, you need -to change the configuration of your CUPS server and set the JobPrivateValue -directive to "none" (or some other list of values which does not include -"job-name") , and reload the server. See `cupsd.conf(5) -` for details. +The jobs will be sent to the printer with a name matching the +print_report_name of the report (truncated at 80 characters). By default +this will not be displayed by CUPS web interface or in Odoo. To see this +information, you need to change the configuration of your CUPS server +and set the JobPrivateValue directive to "none" (or some other list of +values which does not include "job-name") , and reload the server. See +cupsd.conf(5) for +details. Usage ===== Guidelines for use: - * To update the CUPS printers in *Settings > Printing > Update Printers - from CUPS* - * To print a report on a specific printer or tray, you can change - these in *Settings > Printing > Reports* to define default behaviour. - * To print a report on a specific printer and/or tray for a user, you can - change these in *Settings > Printing > Reports* in - *Specific actions per user* - * Users may also select a default action, printer or tray in their preferences. + - To update the CUPS printers in *Settings > Printing > Update + Printers from CUPS* + - To print a report on a specific printer or tray, you can change + these in *Settings > Printing > Reports* to define default + behaviour. + - To print a report on a specific printer and/or tray for a user, + you can change these in *Settings > Printing > Reports* in + *Specific actions per user* + - Users may also select a default action, printer or tray in their + preferences. -When no tray is configured for a report and a user, the -default tray setup on the CUPS server is used. +When no tray is configured for a report and a user, the default tray +setup on the CUPS server is used. Changelog ========= 13.0.1.0.0 (2019-09-30) -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- -* [RELEASE] Port from V12. +- [RELEASE] Port from V12. 12.0.1.0.0 (2018-02-04) -~~~~~~~~~~~~~~~~~~~~~~~ +----------------------- -* [RELEASE] Port from V11. +- [RELEASE] Port from V11. Bug Tracker =========== @@ -125,7 +130,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. @@ -133,7 +138,7 @@ Credits ======= Authors -~~~~~~~ +------- * Agile Business Group & Domsense * Pegueroles SCP @@ -143,28 +148,28 @@ Authors * Open for Small Business Ltd Contributors -~~~~~~~~~~~~ +------------ -* Ferran Pegueroles -* Albert Cervera i Areny -* Davide Corio -* Lorenzo Battistini -* Yannick Vaucher -* Lionel Sausin -* Guewen Baconnier -* Dave Lasley -* Sylvain Garancher -* Jairo Llopis -* Graeme Gellatly -* Rod Schouteden -* Alexandre Fayolle -* Matias Peralta -* Hughes Damry -* Akim Juillerat -* Jacques-Etienne Baudoux (BCIM) +- Ferran Pegueroles +- Albert Cervera i Areny +- Davide Corio +- Lorenzo Battistini +- Yannick Vaucher +- Lionel Sausin +- Guewen Baconnier +- Dave Lasley +- Sylvain Garancher +- Jairo Llopis +- Graeme Gellatly +- Rod Schouteden +- Alexandre Fayolle +- Matias Peralta +- Hughes Damry +- Akim Juillerat +- Jacques-Etienne Baudoux (BCIM) Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -176,6 +181,6 @@ 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. -This module is part of the `OCA/report-print-send `_ project on GitHub. +This module is part of the `OCA/report-print-send `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_report_to_printer/models/printing_printer.py b/base_report_to_printer/models/printing_printer.py index dec7605..c9ff9fd 100644 --- a/base_report_to_printer/models/printing_printer.py +++ b/base_report_to_printer/models/printing_printer.py @@ -183,17 +183,14 @@ class PrintingPrinter(models.Model): options = self.print_options(report=report, **print_opts) _logger.debug( - "Sending job to CUPS printer %s on %s with options %s" - % (self.system_name, self.server_id.address, options) + f"Sending job to CUPS printer {self.system_name} on {self.server_id.address} with options {options}" ) connection.printFile(self.system_name, file_name, title, options=options) - _logger.info( - "Printing job: '{}' on {}".format(file_name, self.server_id.address) - ) + _logger.info(f"Printing job: '{file_name}' on {self.server_id.address}") try: os.remove(file_name) except OSError as exc: - _logger.warning("Unable to remove temporary file %s: %s", file_name, exc) + _logger.warning(f"Unable to remove temporary file {file_name}: {exc}") return True def set_default(self): diff --git a/base_report_to_printer/models/printing_server.py b/base_report_to_printer/models/printing_server.py index 06de8fa..d5958f7 100644 --- a/base_report_to_printer/models/printing_server.py +++ b/base_report_to_printer/models/printing_server.py @@ -8,7 +8,6 @@ from odoo import _, exceptions, fields, models _logger = logging.getLogger(__name__) - try: import cups except ImportError: @@ -87,6 +86,7 @@ class PrintingServer(models.Model): def action_update_printers(self): return self.update_printers(raise_on_error=True) + # ruff: noqa: B023 def update_printers(self, domain=None, raise_on_error=False): if domain is None: domain = [] diff --git a/base_report_to_printer/pyproject.toml b/base_report_to_printer/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/base_report_to_printer/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/base_report_to_printer/readme/CONFIGURE.md b/base_report_to_printer/readme/CONFIGURE.md new file mode 100644 index 0000000..aab90ff --- /dev/null +++ b/base_report_to_printer/readme/CONFIGURE.md @@ -0,0 +1,13 @@ +To configure this module, you need to: + +1. Enable the "Printing / Print User" option under access rights to + give users the ability to view the print menu. + +The jobs will be sent to the printer with a name matching the +print_report_name of the report (truncated at 80 characters). By default +this will not be displayed by CUPS web interface or in Odoo. To see this +information, you need to change the configuration of your CUPS server +and set the JobPrivateValue directive to "none" (or some other list of +values which does not include "job-name") , and reload the server. See +cupsd.conf(5) \ for +details. diff --git a/base_report_to_printer/readme/CONFIGURE.rst b/base_report_to_printer/readme/CONFIGURE.rst deleted file mode 100644 index 3463730..0000000 --- a/base_report_to_printer/readme/CONFIGURE.rst +++ /dev/null @@ -1,13 +0,0 @@ -To configure this module, you need to: - -#. Enable the "Printing / Print User" option under access - rights to give users the ability to view the print menu. - - -The jobs will be sent to the printer with a name matching the print_report_name -of the report (truncated at 80 characters). By default this will not be -displayed by CUPS web interface or in Odoo. To see this information, you need -to change the configuration of your CUPS server and set the JobPrivateValue -directive to "none" (or some other list of values which does not include -"job-name") , and reload the server. See `cupsd.conf(5) -` for details. diff --git a/base_report_to_printer/readme/CONTRIBUTORS.md b/base_report_to_printer/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..2e89c72 --- /dev/null +++ b/base_report_to_printer/readme/CONTRIBUTORS.md @@ -0,0 +1,17 @@ +- Ferran Pegueroles \<\> +- Albert Cervera i Areny \<\> +- Davide Corio \<\> +- Lorenzo Battistini \<\> +- Yannick Vaucher \<\> +- Lionel Sausin \<\> +- Guewen Baconnier \<\> +- Dave Lasley \<\> +- Sylvain Garancher \<\> +- Jairo Llopis \<\> +- Graeme Gellatly \<\> +- Rod Schouteden \<\> +- Alexandre Fayolle \<\> +- Matias Peralta \<\> +- Hughes Damry \<\> +- Akim Juillerat \<\> +- Jacques-Etienne Baudoux (BCIM) \<\> diff --git a/base_report_to_printer/readme/CONTRIBUTORS.rst b/base_report_to_printer/readme/CONTRIBUTORS.rst deleted file mode 100644 index 4626c55..0000000 --- a/base_report_to_printer/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,17 +0,0 @@ -* Ferran Pegueroles -* Albert Cervera i Areny -* Davide Corio -* Lorenzo Battistini -* Yannick Vaucher -* Lionel Sausin -* Guewen Baconnier -* Dave Lasley -* Sylvain Garancher -* Jairo Llopis -* Graeme Gellatly -* Rod Schouteden -* Alexandre Fayolle -* Matias Peralta -* Hughes Damry -* Akim Juillerat -* Jacques-Etienne Baudoux (BCIM) diff --git a/base_report_to_printer/readme/DESCRIPTION.rst b/base_report_to_printer/readme/DESCRIPTION.md similarity index 71% rename from base_report_to_printer/readme/DESCRIPTION.rst rename to base_report_to_printer/readme/DESCRIPTION.md index e6d6278..93a46b3 100644 --- a/base_report_to_printer/readme/DESCRIPTION.rst +++ b/base_report_to_printer/readme/DESCRIPTION.md @@ -1,9 +1,12 @@ -This module allows users to send reports to a printer attached to the server. +This module allows users to send reports to a printer attached to the +server. -It adds an optional behaviour on reports to send it directly to a printer. +It adds an optional behaviour on reports to send it directly to a +printer. -* `Send to Client` is the default behaviour providing you a downloadable PDF -* `Send to Printer` prints the report on selected printer +- Send to Client is the default behaviour providing you a downloadable + PDF +- Send to Printer prints the report on selected printer It detects trays on printers installation plus permits to select the paper source on which you want to print directly. @@ -18,7 +21,7 @@ preprinted paper such as payment slip. Settings can be configured: -* globally -* per user -* per report -* per user and report +- globally +- per user +- per report +- per user and report diff --git a/base_report_to_printer/readme/HISTORY.md b/base_report_to_printer/readme/HISTORY.md new file mode 100644 index 0000000..d7372fe --- /dev/null +++ b/base_report_to_printer/readme/HISTORY.md @@ -0,0 +1,7 @@ +## 13.0.1.0.0 (2019-09-30) + +- \[RELEASE\] Port from V12. + +## 12.0.1.0.0 (2018-02-04) + +- \[RELEASE\] Port from V11. diff --git a/base_report_to_printer/readme/HISTORY.rst b/base_report_to_printer/readme/HISTORY.rst deleted file mode 100644 index 79d9886..0000000 --- a/base_report_to_printer/readme/HISTORY.rst +++ /dev/null @@ -1,9 +0,0 @@ -13.0.1.0.0 (2019-09-30) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [RELEASE] Port from V12. - -12.0.1.0.0 (2018-02-04) -~~~~~~~~~~~~~~~~~~~~~~~ - -* [RELEASE] Port from V11. diff --git a/base_report_to_printer/readme/INSTALL.md b/base_report_to_printer/readme/INSTALL.md new file mode 100644 index 0000000..08df9c9 --- /dev/null +++ b/base_report_to_printer/readme/INSTALL.md @@ -0,0 +1,10 @@ +To install this module, you need to: + +1. Install PyCups - + +``` bash +sudo apt-get install cups +sudo apt-get install libcups2-dev +sudo apt-get install python3-dev +sudo pip install pycups +``` diff --git a/base_report_to_printer/readme/INSTALL.rst b/base_report_to_printer/readme/INSTALL.rst deleted file mode 100644 index a77fc91..0000000 --- a/base_report_to_printer/readme/INSTALL.rst +++ /dev/null @@ -1,10 +0,0 @@ -To install this module, you need to: - -#. Install PyCups - https://pypi.python.org/pypi/pycups - -.. code-block:: bash - - sudo apt-get install cups - sudo apt-get install libcups2-dev - sudo apt-get install python3-dev - sudo pip install pycups diff --git a/base_report_to_printer/readme/USAGE.md b/base_report_to_printer/readme/USAGE.md new file mode 100644 index 0000000..570c4a1 --- /dev/null +++ b/base_report_to_printer/readme/USAGE.md @@ -0,0 +1,15 @@ +Guidelines for use: + +> - To update the CUPS printers in *Settings \> Printing \> Update +> Printers from CUPS* +> - To print a report on a specific printer or tray, you can change +> these in *Settings \> Printing \> Reports* to define default +> behaviour. +> - To print a report on a specific printer and/or tray for a user, you +> can change these in *Settings \> Printing \> Reports* in *Specific +> actions per user* +> - Users may also select a default action, printer or tray in their +> preferences. + +When no tray is configured for a report and a user, the default tray +setup on the CUPS server is used. diff --git a/base_report_to_printer/readme/USAGE.rst b/base_report_to_printer/readme/USAGE.rst deleted file mode 100644 index 3f37116..0000000 --- a/base_report_to_printer/readme/USAGE.rst +++ /dev/null @@ -1,13 +0,0 @@ -Guidelines for use: - - * To update the CUPS printers in *Settings > Printing > Update Printers - from CUPS* - * To print a report on a specific printer or tray, you can change - these in *Settings > Printing > Reports* to define default behaviour. - * To print a report on a specific printer and/or tray for a user, you can - change these in *Settings > Printing > Reports* in - *Specific actions per user* - * Users may also select a default action, printer or tray in their preferences. - -When no tray is configured for a report and a user, the -default tray setup on the CUPS server is used. diff --git a/base_report_to_printer/static/description/index.html b/base_report_to_printer/static/description/index.html index 813e562..ac882d0 100644 --- a/base_report_to_printer/static/description/index.html +++ b/base_report_to_printer/static/description/index.html @@ -1,530 +1,777 @@ - - + - - - -Report to printer - - - -
-

Report to printer

- - -

Beta License: AGPL-3 OCA/report-print-send Translate me on Weblate Try me on Runboat

-

This module allows users to send reports to a printer attached to the server.

-

It adds an optional behaviour on reports to send it directly to a printer.

-
    -
  • Send to Client is the default behaviour providing you a downloadable PDF
  • -
  • Send to Printer prints the report on selected printer
  • -
-

It detects trays on printers installation plus permits to select the -paper source on which you want to print directly.

-

Report behaviour is defined by settings.

-

You will find this option on default user config, on default report -config and on specific config per user per report.

-

This allows you to dedicate a specific paper source for example for -preprinted paper such as payment slip.

-

Settings can be configured:

-
    -
  • globally
  • -
  • per user
  • -
  • per report
  • -
  • per user and report
  • -
-

Table of contents

- -
-

Installation

-

To install this module, you need to:

-
    -
  1. Install PyCups - https://pypi.python.org/pypi/pycups
  2. -
-
-sudo apt-get install cups
-sudo apt-get install libcups2-dev
-sudo apt-get install python3-dev
-sudo pip install pycups
-
-
-
-

Configuration

-

To configure this module, you need to:

-
    -
  1. Enable the “Printing / Print User” option under access -rights to give users the ability to view the print menu.
  2. -
-

The jobs will be sent to the printer with a name matching the print_report_name -of the report (truncated at 80 characters). By default this will not be -displayed by CUPS web interface or in Odoo. To see this information, you need -to change the configuration of your CUPS server and set the JobPrivateValue -directive to “none” (or some other list of values which does not include -“job-name”) , and reload the server. See cupsd.conf(5) -<https://www.cups.org/doc/man-cupsd.conf.html> for details.

-
-
-

Usage

-

Guidelines for use:

-
-
    -
  • To update the CUPS printers in Settings > Printing > Update Printers -from CUPS
  • -
  • To print a report on a specific printer or tray, you can change -these in Settings > Printing > Reports to define default behaviour.
  • -
  • To print a report on a specific printer and/or tray for a user, you can -change these in Settings > Printing > Reports in -Specific actions per user
  • -
  • Users may also select a default action, printer or tray in their preferences.
  • -
-
-

When no tray is configured for a report and a user, the -default tray setup on the CUPS server is used.

-
-
-

Changelog

-
-

13.0.1.0.0 (2019-09-30)

-
    -
  • [RELEASE] Port from V12.
  • -
-
-
-

12.0.1.0.0 (2018-02-04)

-
    -
  • [RELEASE] Port from V11.
  • -
-
-
-
-

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.

-

Do not contact contributors directly about support or help with technical issues.

-
-
-

Credits

-
-

Authors

-
    -
  • Agile Business Group & Domsense
  • -
  • Pegueroles SCP
  • -
  • NaN
  • -
  • LasLabs
  • -
  • Camptocamp
  • -
  • Open for Small Business Ltd
  • -
-
-
-

Contributors

- -
-
-

Maintainers

-

This module is maintained by the OCA.

-Odoo Community Association -

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.

-

This module is part of the OCA/report-print-send project on GitHub.

-

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

-
-
-
- + + + + Report to printer + + + +
+

Report to printer

+ + +

+ + Beta + + + License: AGPL-3 + + + OCA/report-print-send + + + Translate me on Weblate + + + Try me on Runboat + +

+

This module allows users to send reports to a printer attached to the + server. +

+

It adds an optional behaviour on reports to send it directly to a + printer. +

+
    +
  • Send to Client is the default behaviour providing you a downloadable + PDF +
  • +
  • Send to Printer prints the report on selected printer
  • +
+

It detects trays on printers installation plus permits to select the + paper source on which you want to print directly. +

+

Report behaviour is defined by settings.

+

You will find this option on default user config, on default report + config and on specific config per user per report. +

+

This allows you to dedicate a specific paper source for example for + preprinted paper such as payment slip. +

+

Settings can be configured:

+
    +
  • globally
  • +
  • per user
  • +
  • per report
  • +
  • per user and report
  • +
+

+ Table of contents +

+ +
+

+ Installation +

+

To install this module, you need to:

+
    +
  1. Install PyCups - + + https://pypi.python.org/pypi/pycups + +
  2. +
+
+                    sudoapt-getinstallcups
+                sudoapt-getinstall
+                    libcups2-dev
+                sudoapt-getinstall
+                    python3-dev
+                sudopipinstallpycups
+                
+
+
+

+ Configuration +

+

To configure this module, you need to:

+
    +
  1. Enable the “Printing / Print User” option under access rights to give + users the ability to view the print menu. +
  2. +
+

The jobs will be sent to the printer with a name matching the + print_report_name of the report (truncated at 80 characters). By default + this will not be displayed by CUPS web interface or in Odoo. To see this + information, you need to change the configuration of your CUPS server + and set the JobPrivateValue directive to “none” (or some other list of + values which does not include “job-name”) , and reload the server. See + cupsd.conf(5) < + https://www.cups.org/doc/man-cupsd.conf.html> for + details. +

+
+
+

+ Usage +

+

Guidelines for use:

+
+
    +
  • To update the CUPS printers in + Settings > Printing > Update + Printers from CUPS + +
  • +
  • To print a report on a specific printer or tray, you can change + these in + Settings > Printing > Reports + to define default + behaviour. +
  • +
  • To print a report on a specific printer and/or tray for a user, + you can change these in + Settings > Printing > Reports + in + Specific actions per user +
  • +
  • Users may also select a default action, printer or tray in their + preferences. +
  • +
+
+

When no tray is configured for a report and a user, the default tray + setup on the CUPS server is used. +

+
+
+

+ Changelog +

+
+

+ 13.0.1.0.0 (2019-09-30) +

+
    +
  • [RELEASE] Port from V12.
  • +
+
+
+

+ 12.0.1.0.0 (2018-02-04) +

+
    +
  • [RELEASE] Port from V11.
  • +
+
+
+
+

+ 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. +

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

+ Credits +

+
+

+ Authors +

+
    +
  • Agile Business Group & Domsense
  • +
  • Pegueroles SCP
  • +
  • NaN
  • +
  • LasLabs
  • +
  • Camptocamp
  • +
  • Open for Small Business Ltd
  • +
+
+
+

+ Contributors +

+ +
+
+

+ Maintainers +

+

This module is maintained by the OCA.

+ + Odoo Community Association + +

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. +

+

This module is part of the + + OCA/report-print-send + + project on GitHub. +

+

You are welcome to contribute. To learn how please visit + https://odoo-community.org/page/Contribute. +

+
+
+
+ diff --git a/base_report_to_printer/tests/test_ir_actions_report.py b/base_report_to_printer/tests/test_ir_actions_report.py index 64332f9..0ba5a87 100644 --- a/base_report_to_printer/tests/test_ir_actions_report.py +++ b/base_report_to_printer/tests/test_ir_actions_report.py @@ -11,7 +11,7 @@ model = "odoo.addons.base.models.ir_actions_report.IrActionsReport" class TestIrActionsReportXml(TransactionCase): def setUp(self): - super(TestIrActionsReportXml, self).setUp() + super().setUp() self.Model = self.env["ir.actions.report"] self.vals = {} @@ -77,7 +77,7 @@ class TestIrActionsReportXml(TransactionCase): "action": behaviour["action"], "printer_name": behaviour["printer"].name, } - self.assertDictEqual(expect, res, "Expect {}, Got {}".format(expect, res)) + self.assertDictEqual(expect, res, f"Expect {expect}, Got {res}") def test_behaviour_default_values(self): """It should return the default action and printer""" diff --git a/base_report_to_printer/tests/test_printing_job.py b/base_report_to_printer/tests/test_printing_job.py index 1f5c929..dd02a10 100644 --- a/base_report_to_printer/tests/test_printing_job.py +++ b/base_report_to_printer/tests/test_printing_job.py @@ -11,7 +11,7 @@ model = "odoo.addons.base_report_to_printer.models.printing_server" class TestPrintingJob(TransactionCase): def setUp(self): - super(TestPrintingJob, self).setUp() + super().setUp() self.Model = self.env["printing.server"] self.server = self.Model.create({}) self.printer_vals = { diff --git a/base_report_to_printer/tests/test_printing_printer.py b/base_report_to_printer/tests/test_printing_printer.py index 6cadf02..8ea7d83 100644 --- a/base_report_to_printer/tests/test_printing_printer.py +++ b/base_report_to_printer/tests/test_printing_printer.py @@ -13,7 +13,7 @@ server_model = "odoo.addons.base_report_to_printer.models.printing_server" class TestPrintingPrinter(TransactionCase): def setUp(self): - super(TestPrintingPrinter, self).setUp() + super().setUp() self.Model = self.env["printing.printer"] self.ServerModel = self.env["printing.server"] self.server = self.env["printing.server"].create({}) diff --git a/base_report_to_printer/tests/test_printing_printer_tray.py b/base_report_to_printer/tests/test_printing_printer_tray.py index 22bbcc4..1588643 100644 --- a/base_report_to_printer/tests/test_printing_printer_tray.py +++ b/base_report_to_printer/tests/test_printing_printer_tray.py @@ -34,7 +34,7 @@ ppd_input_slot_footer = """ class TestPrintingPrinter(TransactionCase): def setUp(self): - super(TestPrintingPrinter, self).setUp() + super().setUp() self.Model = self.env["printing.printer"] self.ServerModel = self.env["printing.server"] self.server = self.env["printing.server"].create({}) diff --git a/base_report_to_printer/tests/test_printing_report_xml_action.py b/base_report_to_printer/tests/test_printing_report_xml_action.py index af0e1dc..5643642 100644 --- a/base_report_to_printer/tests/test_printing_report_xml_action.py +++ b/base_report_to_printer/tests/test_printing_report_xml_action.py @@ -6,7 +6,7 @@ from odoo.tests.common import TransactionCase class TestPrintingReportXmlAction(TransactionCase): def setUp(self): - super(TestPrintingReportXmlAction, self).setUp() + super().setUp() self.Model = self.env["printing.report.xml.action"] self.report = self.env["ir.actions.report"].search([], limit=1) diff --git a/base_report_to_printer/tests/test_printing_server.py b/base_report_to_printer/tests/test_printing_server.py index 1cecc12..9fb2151 100644 --- a/base_report_to_printer/tests/test_printing_server.py +++ b/base_report_to_printer/tests/test_printing_server.py @@ -12,7 +12,7 @@ model_base = "odoo.models.BaseModel" class TestPrintingServer(TransactionCase): def setUp(self): - super(TestPrintingServer, self).setUp() + super().setUp() self.Model = self.env["printing.server"] self.server = self.Model.create({}) self.printer_vals = { diff --git a/base_report_to_printer/tests/test_printing_tray.py b/base_report_to_printer/tests/test_printing_tray.py index fed2724..ce5f001 100644 --- a/base_report_to_printer/tests/test_printing_tray.py +++ b/base_report_to_printer/tests/test_printing_tray.py @@ -8,7 +8,7 @@ model = "odoo.addons.base_report_to_printer.models.printing_server" class TestPrintingTray(TransactionCase): def setUp(self): - super(TestPrintingTray, self).setUp() + super().setUp() self.Model = self.env["printing.tray"] self.server = self.env["printing.server"].create({}) self.printer = self.env["printing.printer"].create( diff --git a/base_report_to_printer/tests/test_report.py b/base_report_to_printer/tests/test_report.py index 7821510..e93d0a0 100644 --- a/base_report_to_printer/tests/test_report.py +++ b/base_report_to_printer/tests/test_report.py @@ -10,7 +10,7 @@ from odoo.tests import common class TestReport(common.HttpCase): def setUp(self): - super(TestReport, self).setUp() + super().setUp() self.Model = self.env["ir.actions.report"] self.server = self.env["printing.server"].create({}) self.report_vals = { diff --git a/base_report_to_printer/tests/test_res_users.py b/base_report_to_printer/tests/test_res_users.py index 6f3df48..020c632 100644 --- a/base_report_to_printer/tests/test_res_users.py +++ b/base_report_to_printer/tests/test_res_users.py @@ -6,7 +6,7 @@ from odoo.tests import common class TestResUsers(common.TransactionCase): def setUp(self): - super(TestResUsers, self).setUp() + super().setUp() self.user_vals = {"name": "Test", "login": "login"} def new_record(self):