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

[WIP][MIG][11.0] l10n_us_check_writing_address #31

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions l10n_us_check_writing_address/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
====================================
US Check Printing with Payee Address
====================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fl10n--usa-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-usa/tree/11.0/l10n_us_check_writing_address
:alt: OCA/l10n-usa
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-usa-11-0/l10n-usa-11-0-l10n_us_check_writing_address
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/203/11.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

===================================
US Check Writing with Payee Address
===================================

This module allows to print your payments on pre-printed check paper.
This module adds the address to the Payee section of a check.

Supported formats
-----------------

* Check on top: Quicken / QuickBooks standard
* Check in the middle: Peachtree standard
* Check at the bottom: ADP standard

**Table of contents**

.. contents::
:local:

Configuration
=============

You can configure the output (layout, stubs informations, etc.) in company
settings, and manage the checks numbering (if you use pre-printed checks
without numbers) in the journal settings.

Usage
=====


To use this module, you need to:

#. Go to Accounting > Purchases > Payments
#. Create a new payment with a payment method (journal) configured to print
check
#. Check the check option, register the payment and print the check

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-usa/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 <https://github.com/OCA/l10n-usa/issues/new?body=module:%20l10n_us_check_writing_address%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* Bhavesh Odedra <bodedra@ursainfosystems.com>
* Sandip Mangukiya <smangukiya@ursainfosystems.com>
* Sudarshan Kadalazhi <skadalazhi@ursainfosystems.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

Other credits
~~~~~~~~~~~~~

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Funders
-------

The development of this module has been financially supported by:

* Open Source Integrators <https://www.opensourceintegrators.com>

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/l10n-usa <https://github.com/OCA/l10n-usa/tree/11.0/l10n_us_check_writing_address>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions l10n_us_check_writing_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2019 Open Source Integrators
# <https://www.opensourceintegrators.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions l10n_us_check_writing_address/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2019 Open Source Integrators
# <https://www.opensourceintegrators.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'US Check Printing with Payee Address',
'summary': 'Print US Checks',
'version': '11.0.1.0.0',
'license': 'AGPL-3',
'author': 'Open Source Integrators, Odoo Community Association (OCA)',
'category': 'Localization/Checks Printing',
'maintainer': 'Open Source Integrators',
'website': 'https://github.com/OCA/l10n-usa',
'depends': [
'account_check_printing_report_base',
],
'data': [
],
'development_sattus': 'Beta',
'maintainers': ['max3903'],
'installable': True,
}
3 changes: 3 additions & 0 deletions l10n_us_check_writing_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import res_partner
52 changes: 52 additions & 0 deletions l10n_us_check_writing_address/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2019 Open Source Integrators
# <https://www.opensourceintegrators.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import api, models

DEFAULT_ADDRESS_FORMAT = "%(street)s\n" \
"%(street2)s\n" \
"%(city)s %(state_code)s %(zip)s\n" \
"%(country_name)s"


class ResPartner(models.Model):
_inherit = "res.partner"

@api.multi
def _display_address(self, without_company=False):
'''Build a formatted address based on the country.

The purpose of this function is to build and return an address
formatted according to the standards of the country where it belongs.

Args:
address (res.partner): browse record of the res.partner to format

Returns:
string: the address formatted in a display that fit its country
habits (or the default one if no country is specified)

'''
# get the information that will be injected into the display format
# get the address format
address_format = self.country_id.address_format
if not address_format:
address_format = DEFAULT_ADDRESS_FORMAT
if not self.street2:
address_format = address_format.replace('%(street2)\n', '')
args = {
'state_code': self.state_id.code or '',
'state_name': self.state_id.name or '',
'country_code': self.country_id.code or '',
'country_name': self.country_id.name or '',
'company_name': self.parent_name or '',
}
for field in self._address_fields():
args[field] = getattr(self, field) or ''
if without_company:
args['company_name'] = ''
elif self.parent_id:
address_format = '%(company_name)s\n' + address_format
return address_format % args
3 changes: 3 additions & 0 deletions l10n_us_check_writing_address/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You can configure the output (layout, stubs informations, etc.) in company
settings, and manage the checks numbering (if you use pre-printed checks
without numbers) in the journal settings.
4 changes: 4 additions & 0 deletions l10n_us_check_writing_address/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* Bhavesh Odedra <bodedra@ursainfosystems.com>
* Sandip Mangukiya <smangukiya@ursainfosystems.com>
* Sudarshan Kadalazhi <skadalazhi@ursainfosystems.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
11 changes: 11 additions & 0 deletions l10n_us_check_writing_address/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Funders
-------

The development of this module has been financially supported by:

* Open Source Integrators <https://www.opensourceintegrators.com>
13 changes: 13 additions & 0 deletions l10n_us_check_writing_address/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
===================================
US Check Writing with Payee Address
===================================

This module allows to print your payments on pre-printed check paper.
This module adds the address to the Payee section of a check.

Supported formats
-----------------

* Check on top: Quicken / QuickBooks standard
* Check in the middle: Peachtree standard
* Check at the bottom: ADP standard
6 changes: 6 additions & 0 deletions l10n_us_check_writing_address/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:

#. Go to Accounting > Purchases > Payments
#. Create a new payment with a payment method (journal) configured to print
check
#. Check the check option, register the payment and print the check
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.