diff --git a/account_voucher_print/README.rst b/account_voucher_print/README.rst new file mode 100644 index 000000000..bcf9bc61f --- /dev/null +++ b/account_voucher_print/README.rst @@ -0,0 +1,73 @@ +================ +Receipt Printing +================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/12.0/account_voucher_print + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-12-0/account-financial-tools-12-0-account_voucher_print + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows printing of sale and purchase receipts. + +**Table of contents** + +.. contents:: + :local: + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Pordenone Linux User Group (PNLUG) + +Contributors +~~~~~~~~~~~~ + +* Sergio Zanchetta + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_voucher_print/__init__.py b/account_voucher_print/__init__.py new file mode 100644 index 000000000..08e5a58a9 --- /dev/null +++ b/account_voucher_print/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2020 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/account_voucher_print/__manifest__.py b/account_voucher_print/__manifest__.py new file mode 100644 index 000000000..8ed01a0b6 --- /dev/null +++ b/account_voucher_print/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2020 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Receipt Printing', + 'version': '12.0.1.0.0', + 'category': 'Accounting & Finance', + 'summary': 'Enable printing in sale and purchase receipts', + 'author': 'Pordenone Linux User Group (PNLUG), Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/account-financial-reporting', + 'license': 'AGPL-3', + 'depends': [ + 'account_voucher'], + 'data': ['views/report_receipt.xml', + 'views/account_report.xml'], + 'installable': True, +} diff --git a/account_voucher_print/i18n/it.po b/account_voucher_print/i18n/it.po new file mode 100644 index 000000000..b6ce5ab9f --- /dev/null +++ b/account_voucher_print/i18n/it.po @@ -0,0 +1,140 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_voucher_print +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-07-10 12:42+0000\n" +"PO-Revision-Date: 2020-07-10 14:45+0200\n" +"Last-Translator: Sergio Zanchetta \n" +"Language-Team: \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.0.6\n" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Amount" +msgstr "Importo" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Description" +msgstr "Descrizione" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Quantity" +msgstr "Quantità" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Taxes" +msgstr "Imposte" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Unit Price" +msgstr "Prezzo unitario" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Amount In Words:" +msgstr "Importo in lettere:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Bill Date:" +msgstr "Data ricevuta:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Bill Reference:" +msgstr "Riferimento ricevuta:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Due Date:" +msgstr "Data scadenza:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Subtotal" +msgstr "Imponibile" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Total" +msgstr "Totale" + +#. module: account_voucher_print +#: model:ir.model,name:account_voucher_print.model_account_voucher +msgid "Accounting Voucher" +msgstr "Ricevuta contabile" + +#. module: account_voucher_print +#: model:ir.model.fields,field_description:account_voucher_print.field_account_voucher__amount_in_words +msgid "Amount In Words" +msgstr "Importo in lettere" + +#. module: account_voucher_print +#: code:addons/account_voucher_print/models/account_voucher.py:24 +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +#, python-format +msgid "Draft Purchase Receipt" +msgstr "Ricevuta di acquisto in bozza" + +#. module: account_voucher_print +#: code:addons/account_voucher_print/models/account_voucher.py:18 +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +#, python-format +msgid "Draft Receipt" +msgstr "Ricevuta in bozza" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Payment Memo:" +msgstr "Promemoria pagamento:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Please use the following communication for your payment:" +msgstr "Per il pagamento utilizzare la seguente indicazione:" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Purchase Receipt" +msgstr "Ricevuta di acquisto" + +#. module: account_voucher_print +#: code:addons/account_voucher_print/models/account_voucher.py:27 +#, python-format +msgid "Purchase Receipt - %s" +msgstr "Ricevuta di acquisto - %s" + +#. module: account_voucher_print +#: model:ir.actions.report,name:account_voucher_print.account_receipts +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Receipt" +msgstr "Ricevuta" + +#. module: account_voucher_print +#: code:addons/account_voucher_print/models/account_voucher.py:21 +#, python-format +msgid "Receipt - %s" +msgstr "Ricevuta - %s" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Tax Amount" +msgstr "Importo imposta" + +#. module: account_voucher_print +#: model_terms:ir.ui.view,arch_db:account_voucher_print.report_receipt_document +msgid "Tax Correction" +msgstr "Correzione imposta" diff --git a/account_voucher_print/models/__init__.py b/account_voucher_print/models/__init__.py new file mode 100644 index 000000000..6717eb368 --- /dev/null +++ b/account_voucher_print/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2020 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import account_voucher diff --git a/account_voucher_print/models/account_voucher.py b/account_voucher_print/models/account_voucher.py new file mode 100644 index 000000000..017b0c464 --- /dev/null +++ b/account_voucher_print/models/account_voucher.py @@ -0,0 +1,38 @@ +# Copyright 2020 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models, api, _ + + +class AccountVoucher(models.Model): + _inherit = "account.voucher" + + amount_in_words = fields.Char("Amount In Words", compute="_compute_amount_in_words") + + @api.multi + def _get_report_base_filename(self): + self.ensure_one() + return \ + self.voucher_type == 'sale' and \ + self.state == 'draft' and \ + _('Draft Receipt') or \ + self.voucher_type == 'sale' and \ + self.state in ('proforma', 'posted') and \ + _('Receipt - %s') % (self.number) or \ + self.voucher_type == 'purchase' and \ + self.state == 'draft' and \ + _('Draft Purchase Receipt') or \ + self.voucher_type == 'purchase' and \ + self.state in ('proforma', 'posted') and \ + _('Purchase Receipt - %s') % (self.number) + + @api.depends('amount') + def _compute_amount_in_words(self): + for receipt in self: + receipt.amount_in_words = receipt.currency_id.amount_to_text(receipt.amount) + + @api.multi + def receipt_print(self): + """Print the receipt""" + return self.env.ref( + 'account_voucher_print.account_receipts').report_action(self, data='') diff --git a/account_voucher_print/readme/CONTRIBUTORS.rst b/account_voucher_print/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..4a6ef167e --- /dev/null +++ b/account_voucher_print/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sergio Zanchetta diff --git a/account_voucher_print/readme/DESCRIPTION.rst b/account_voucher_print/readme/DESCRIPTION.rst new file mode 100644 index 000000000..f6a2d3d1a --- /dev/null +++ b/account_voucher_print/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows printing of sale and purchase receipts. diff --git a/account_voucher_print/static/description/index.html b/account_voucher_print/static/description/index.html new file mode 100644 index 000000000..96e5b9ab0 --- /dev/null +++ b/account_voucher_print/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +Receipt Printing + + + +
+

Receipt Printing

+ + +

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runbot

+

This module allows printing of sale and purchase receipts.

+

Table of contents

+ +
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Pordenone Linux User Group (PNLUG)
  • +
+
+
+

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/account-financial-tools project on GitHub.

+

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

+
+
+
+ + diff --git a/account_voucher_print/views/account_report.xml b/account_voucher_print/views/account_report.xml new file mode 100644 index 000000000..29864733b --- /dev/null +++ b/account_voucher_print/views/account_report.xml @@ -0,0 +1,13 @@ + + + + diff --git a/account_voucher_print/views/report_receipt.xml b/account_voucher_print/views/report_receipt.xml new file mode 100644 index 000000000..9cf6e926c --- /dev/null +++ b/account_voucher_print/views/report_receipt.xml @@ -0,0 +1,139 @@ + + + + + +