Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][add][account_check_printing_report_sslm102] #246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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)
18 changes: 16 additions & 2 deletions account_check_printing_report_base/report/check_print.py
Expand Up @@ -5,13 +5,25 @@
# 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


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)
Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion account_check_printing_report_dlt103/report/check_print.py
Expand Up @@ -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)
74 changes: 74 additions & 0 deletions 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
<https://github.com/OCA/account-payment/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 <https://odoo-community.org/logo.png>`_.

Contributors
------------

* Jordi Ballester Alomar <jordi.ballester@eficent.com>
* Lois Rilo Antelo <lois.rilo@eficent.com>

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.
7 changes: 7 additions & 0 deletions 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
25 changes: 25 additions & 0 deletions 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,
}
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_payment_check_report_sslm102"
model="account.payment.check.report">
<field name="name">sslm102</field>
<field name="report">account_check_printing_report_sslm102.sslm102</field>
</record>
</odoo>
18 changes: 18 additions & 0 deletions account_check_printing_report_sslm102/data/report_paperformat.xml
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="paperformat_check_sslm102" model="report.paperformat">
<field name="name">US Check Letter for SSLM102</field>
<field name="default" eval="False" />
<field name="format">Letter</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="header_line" eval="False" />
<field name="header_spacing">0</field>
<field name="dpi">90</field>
</record>
</odoo>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="paperformat_sslm102_parameter_disable_smart_shrinking"
model="report.paperformat.parameter">
<field name="paperformat_id"
ref="account_check_printing_report_sslm102.paperformat_check_sslm102"/>
<field name="name">--disable-smart-shrinking</field>
</record>
</odoo>
@@ -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 "<b>Check Amount:</b>"
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 ""

1 change: 1 addition & 0 deletions account_check_printing_report_sslm102/readme/CONFIGURE.rst
@@ -0,0 +1 @@
Go to 'Settings / Users / Companies' and assign the check format 'SSLM102'.
2 changes: 2 additions & 0 deletions account_check_printing_report_sslm102/readme/CONTRIBUTORS.rst
@@ -0,0 +1,2 @@
* Eficent Business and IT Consulting Services, S.L.
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
3 changes: 3 additions & 0 deletions 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
3 changes: 3 additions & 0 deletions 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
3 changes: 3 additions & 0 deletions 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.

7 changes: 7 additions & 0 deletions 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
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<odoo>
<report
id="action_report_check_sslm102"
model="account.payment"
string="Payment Check SSLM102"
report_type="qweb-pdf"
name="account_check_printing_report_sslm102.sslm102"
file="account_check_printing_report_sslm102.sslm102"/>

<record id="action_report_check_sslm102" model="ir.actions.report.xml">
<field name="paperformat_id" ref="account_check_printing_report_sslm102.paperformat_check_sslm102"/>
</record>
</odoo>
17 changes: 17 additions & 0 deletions 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)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.