diff --git a/account_check_printing_report_base/models/account_payment_check_report.py b/account_check_printing_report_base/models/account_payment_check_report.py index 16295f6e4c0..6b936902d54 100644 --- a/account_check_printing_report_base/models/account_payment_check_report.py +++ b/account_check_printing_report_base/models/account_payment_check_report.py @@ -9,6 +9,7 @@ class AccountPaymentCheckReport(models.Model): _name = "account.payment.check.report" + _description = "Account Payment Check Report" name = fields.Char(string='Name', required=True) report = fields.Char(string='Report name', required=True) diff --git a/account_check_printing_report_base/report/check_print.py b/account_check_printing_report_base/report/check_print.py index ee121788ab8..fdd951e7d87 100644 --- a/account_check_printing_report_base/report/check_print.py +++ b/account_check_printing_report_base/report/check_print.py @@ -5,6 +5,8 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import time +from datetime import datetime +from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT from odoo import api, exceptions, models, _ from odoo.tools import float_is_zero @@ -12,6 +14,16 @@ class ReportCheckPrint(models.AbstractModel): _name = 'report.account_check_printing_report_base.report_check_base' + def fill_stars_number(self, amount, stars_prefix=5, stars_suffix=1): + str = ' '.join(['*' * stars_prefix, amount, '*' * stars_suffix]) + return str + + def _format_date_to_partner_lang(self, str_date, partner_id): + lang_code = self.env['res.partner'].browse(partner_id).lang + lang = self.env['res.lang']._lang_get(lang_code) + date = datetime.strptime(str_date, DEFAULT_SERVER_DATE_FORMAT).date() + return date.strftime(lang.date_format) + def fill_stars(self, amount_in_word): if amount_in_word and len(amount_in_word) < 100: stars = 100 - len(amount_in_word) @@ -85,7 +97,7 @@ def get_paid_lines(self, payments): lines[payment.id].append(line) return lines - @api.multi + @api.model def render_html(self, docids, data=None): payments = self.env['account.payment'].browse(docids) paid_lines = self.get_paid_lines(payments) @@ -95,7 +107,9 @@ def render_html(self, docids, data=None): 'docs': payments, 'time': time, 'fill_stars': self.fill_stars, - 'paid_lines': paid_lines + 'fill_stars_number': self.fill_stars_number, + 'paid_lines': paid_lines, + '_format_date_to_partner_lang': self._format_date_to_partner_lang, } if self.env.user.company_id.check_layout_id: return self.env['report'].render( diff --git a/account_check_printing_report_dlt103/report/check_print.py b/account_check_printing_report_dlt103/report/check_print.py index 6ee989b9aef..f6e3877e041 100644 --- a/account_check_printing_report_dlt103/report/check_print.py +++ b/account_check_printing_report_dlt103/report/check_print.py @@ -11,6 +11,6 @@ class ReportCheckPrint(models.AbstractModel): _name = 'report.account_check_printing_report_dlt103.report_check_dlt103' _inherit = 'report.account_check_printing_report_base.report_check_base' - @api.multi + @api.model def render_html(self, docids, data): return super(ReportCheckPrint, self).render_html(docids, data) diff --git a/account_check_printing_report_sslm102/README.rst b/account_check_printing_report_sslm102/README.rst new file mode 100644 index 00000000000..68185a0c23a --- /dev/null +++ b/account_check_printing_report_sslm102/README.rst @@ -0,0 +1,74 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +===================================== +Account Check Printing Report SSLM102 +===================================== + +This module allows you to print SSLM102 lined checks. + +See https://www.google.es/search?q=sslm102 + +Installation +============ + +In order to install this module you must first install also the module +'report_paper_wkhtmltopdf_params', available in +https://github.com/OCA/server-tools + + +Configuration +============= + +Go to 'Settings / Users / Companies' and assign the check format 'SSLM102'. + + +Usage +===== + +* Go to 'Invoicing / Purchases / Payments'. Select one of the payments with + type 'Check' and print the check. + + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/96/10.0 + +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 smash it by providing detailed and welcomed feedback. + + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Jordi Ballester Alomar +* Lois Rilo Antelo + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_check_printing_report_sslm102/__init__.py b/account_check_printing_report_sslm102/__init__.py new file mode 100644 index 00000000000..54316e5acd9 --- /dev/null +++ b/account_check_printing_report_sslm102/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import report diff --git a/account_check_printing_report_sslm102/__manifest__.py b/account_check_printing_report_sslm102/__manifest__.py new file mode 100644 index 00000000000..4b1408f9299 --- /dev/null +++ b/account_check_printing_report_sslm102/__manifest__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Account Check Printing Report SSLM102', + 'summary': 'Allows you to print SSLM102 lined checks.', + 'version': '10.0.1.0.0', + 'license': 'AGPL-3', + 'author': "Eficent," + "Odoo Community Association (OCA)", + 'category': 'Generic Modules/Accounting', + 'website': "https://github.com/OCA/account-payment", + 'depends': ['account_check_printing_report_base'], + 'data': [ + 'data/report_paperformat.xml', + 'data/report_paperformat_parameter.xml', + 'data/account_payment_check_report_data.xml', + 'views/report_check.xml', + 'report/account_check_writing_report.xml', + ], + 'installable': True, +} diff --git a/account_check_printing_report_sslm102/data/account_payment_check_report_data.xml b/account_check_printing_report_sslm102/data/account_payment_check_report_data.xml new file mode 100644 index 00000000000..7a2525b37af --- /dev/null +++ b/account_check_printing_report_sslm102/data/account_payment_check_report_data.xml @@ -0,0 +1,8 @@ + + + + sslm102 + account_check_printing_report_sslm102.sslm102 + + diff --git a/account_check_printing_report_sslm102/data/report_paperformat.xml b/account_check_printing_report_sslm102/data/report_paperformat.xml new file mode 100644 index 00000000000..a8b934bd872 --- /dev/null +++ b/account_check_printing_report_sslm102/data/report_paperformat.xml @@ -0,0 +1,18 @@ + + + + US Check Letter for SSLM102 + + Letter + 0 + 0 + Portrait + 0 + 0 + 0 + 0 + + 0 + 90 + + diff --git a/account_check_printing_report_sslm102/data/report_paperformat_parameter.xml b/account_check_printing_report_sslm102/data/report_paperformat_parameter.xml new file mode 100644 index 00000000000..ff2398d6b6b --- /dev/null +++ b/account_check_printing_report_sslm102/data/report_paperformat_parameter.xml @@ -0,0 +1,9 @@ + + + + + --disable-smart-shrinking + + diff --git a/account_check_printing_report_sslm102/i18n/account_check_printing_report_dlt103.pot b/account_check_printing_report_sslm102/i18n/account_check_printing_report_dlt103.pot new file mode 100644 index 00000000000..6ae121efd0c --- /dev/null +++ b/account_check_printing_report_sslm102/i18n/account_check_printing_report_dlt103.pot @@ -0,0 +1,70 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_check_printing_report_dlt103 +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Check Amount:" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Balance Due" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Description" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.model.fields,field_description:account_check_printing_report_dlt103.field_report_account_check_printing_report_dlt103_report_check_dlt103_display_name +msgid "Display Name" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Due Date" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.model.fields,field_description:account_check_printing_report_dlt103.field_report_account_check_printing_report_dlt103_report_check_dlt103_id +msgid "ID" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.model.fields,field_description:account_check_printing_report_dlt103.field_report_account_check_printing_report_dlt103_report_check_dlt103___last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Original Amount" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.ui.view,arch_db:account_check_printing_report_dlt103.report_check_dlt103 +msgid "Payment" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.actions.report.xml,name:account_check_printing_report_dlt103.action_report_check_dlt103 +msgid "Payment Check DLT103" +msgstr "" + +#. module: account_check_printing_report_dlt103 +#: model:ir.model,name:account_check_printing_report_dlt103.model_report_account_check_printing_report_dlt103_report_check_dlt103 +msgid "report.account_check_printing_report_dlt103.report_check_dlt103" +msgstr "" + diff --git a/account_check_printing_report_sslm102/readme/CONFIGURE.rst b/account_check_printing_report_sslm102/readme/CONFIGURE.rst new file mode 100644 index 00000000000..fdbb529b8d1 --- /dev/null +++ b/account_check_printing_report_sslm102/readme/CONFIGURE.rst @@ -0,0 +1 @@ +Go to 'Settings / Users / Companies' and assign the check format 'SSLM102'. diff --git a/account_check_printing_report_sslm102/readme/CONTRIBUTORS.rst b/account_check_printing_report_sslm102/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..f4775157141 --- /dev/null +++ b/account_check_printing_report_sslm102/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Eficent Business and IT Consulting Services, S.L. + * Jordi Ballester Alomar diff --git a/account_check_printing_report_sslm102/readme/DESCRIPTION.rst b/account_check_printing_report_sslm102/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..e8c79e98df6 --- /dev/null +++ b/account_check_printing_report_sslm102/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows you to print SSLM102 lined checks. + +See https://www.google.es/search?q=sslm102 diff --git a/account_check_printing_report_sslm102/readme/INSTALL.rst b/account_check_printing_report_sslm102/readme/INSTALL.rst new file mode 100644 index 00000000000..44201e3081b --- /dev/null +++ b/account_check_printing_report_sslm102/readme/INSTALL.rst @@ -0,0 +1,3 @@ +In order to install this module you must first install also the module +'report_paper_wkhtmltopdf_params', available in +https://github.com/OCA/server-tools diff --git a/account_check_printing_report_sslm102/readme/USAGE.rst b/account_check_printing_report_sslm102/readme/USAGE.rst new file mode 100644 index 00000000000..23c7b2e53ae --- /dev/null +++ b/account_check_printing_report_sslm102/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to 'Invoicing / Purchases / Payments'. Select one of the payments with + type 'Check' and print the check. + diff --git a/account_check_printing_report_sslm102/report/__init__.py b/account_check_printing_report_sslm102/report/__init__.py new file mode 100644 index 00000000000..f37a165d33a --- /dev/null +++ b/account_check_printing_report_sslm102/report/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import check_print diff --git a/account_check_printing_report_sslm102/report/account_check_writing_report.xml b/account_check_printing_report_sslm102/report/account_check_writing_report.xml new file mode 100644 index 00000000000..dc45ac87cae --- /dev/null +++ b/account_check_printing_report_sslm102/report/account_check_writing_report.xml @@ -0,0 +1,14 @@ + + + + + + + + diff --git a/account_check_printing_report_sslm102/report/check_print.py b/account_check_printing_report_sslm102/report/check_print.py new file mode 100644 index 00000000000..02964db07ce --- /dev/null +++ b/account_check_printing_report_sslm102/report/check_print.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class ReportCheckPrint(models.AbstractModel): + _name = 'report.account_check_printing_report_sslm102.sslm102' + _inherit = 'report.account_check_printing_report_base.report_check_base' + _description = "Check sslm102" + + @api.model + def render_html(self, docids, data): + return super(ReportCheckPrint, self).render_html(docids, data) diff --git a/account_check_printing_report_sslm102/static/description/icon.png b/account_check_printing_report_sslm102/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/account_check_printing_report_sslm102/static/description/icon.png differ diff --git a/account_check_printing_report_sslm102/views/report_check.xml b/account_check_printing_report_sslm102/views/report_check.xml new file mode 100644 index 00000000000..6b9308ac191 --- /dev/null +++ b/account_check_printing_report_sslm102/views/report_check.xml @@ -0,0 +1,100 @@ + + + + + + + +