Skip to content

Commit

Permalink
[FIX]l10n_us_check_writing_address: Add missing parser, Fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Swapnesh-SerpentCS committed Jun 11, 2019
1 parent c0adc3a commit e378024
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 47 deletions.
3 changes: 2 additions & 1 deletion l10n_us_check_writing_address/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import models
from . import report
12 changes: 6 additions & 6 deletions l10n_us_check_writing_address/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
{
'name': 'US Check Printing with Payee Address',
'summary': 'Print US Checks',
'version': '10.0.1.0.0',
'version': '10.0.1.1.0',
'license': 'AGPL-3',
'author': 'Ursa Information Systems, Odoo Community Association (OCA)',
'author': 'Open Source Integrators, Odoo Community Association (OCA)',
'category': 'Localization/Checks Printing',
'maintainer': 'Ursa Information Systems',
'website': 'http://www.ursainfosystems.com',
'maintainer': 'Open Source Integrators',
'website': 'https://www.opensourceintegrators.com',
'depends': [
'account_check_printing_report_base',
],
'data': [
'report/account_check_writing_report.xml',
'data/account_payment_check_report_data.xml',
'report/report_check_base_top.xml',
'report/report_check_base_middle.xml',
'report/report_check_base_bottom.xml',
'data/account_payment_check_report_data.xml',
'report/account_check_writing_report.xml',
],
'installable': True,
}
5 changes: 5 additions & 0 deletions l10n_us_check_writing_address/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import check_print
69 changes: 69 additions & 0 deletions l10n_us_check_writing_address/report/check_print.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import time
from odoo import api, models


class ReportCheckPrintTop(models.AbstractModel):
_name = 'report.l10n_us_check_writing_address.report_check_base_top'
_inherit = 'report.account_check_printing_report_base.report_check_base'

@api.multi
def render_html(self, docids, data=None):
payments = self.env['account.payment'].browse(docids)
paid_lines = self.get_paid_lines(payments)
docargs = {
'doc_ids': docids,
'doc_model': 'account.payment',
'docs': payments,
'time': time,
'fill_stars': self.fill_stars,
'paid_lines': paid_lines
}
return self.env['report'].render(
'l10n_us_check_writing_address.report_check_base_top',
docargs)


class ReportCheckPrintBottom(models.AbstractModel):
_name = 'report.l10n_us_check_writing_address.report_check_base_bottom'
_inherit = 'report.account_check_printing_report_base.report_check_base'

@api.multi
def render_html(self, docids, data=None):
payments = self.env['account.payment'].browse(docids)
paid_lines = self.get_paid_lines(payments)
docargs = {
'doc_ids': docids,
'doc_model': 'account.payment',
'docs': payments,
'time': time,
'fill_stars': self.fill_stars,
'paid_lines': paid_lines
}
return self.env['report'].render(
'l10n_us_check_writing_address.report_check_base_bottom',
docargs)


class ReportCheckPrintMiddle(models.AbstractModel):
_name = 'report.l10n_us_check_writing_address.report_check_base_middle'
_inherit = 'report.account_check_printing_report_base.report_check_base'

@api.multi
def render_html(self, docids, data=None):
payments = self.env['account.payment'].browse(docids)
paid_lines = self.get_paid_lines(payments)
docargs = {
'doc_ids': docids,
'doc_model': 'account.payment',
'docs': payments,
'time': time,
'fill_stars': self.fill_stars,
'paid_lines': paid_lines
}
return self.env['report'].render(
'l10n_us_check_writing_address.report_check_base_middle',
docargs)
32 changes: 15 additions & 17 deletions l10n_us_check_writing_address/report/report_check_base_bottom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<template id="report_check_base_bottom">

<template id="report_check_base_bottom">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<div class="page">
Expand Down Expand Up @@ -39,15 +38,15 @@
</td>
<td>
<span t-esc="line['amount_total']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
<td>
<span t-esc="line['residual']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
<td>
<span t-esc="line['paid_amount']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
</td>
</tr>
</t>
Expand All @@ -62,20 +61,19 @@
</t>
</div>
<div style="padding-top:20mm;">
<address t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}'/>
<span t-esc="o.payment_date"/>
<br/>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
<br/>
<span t-esc="fill_stars(o.check_amount_in_words)"/>
</div>
<address t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}'/>

<span t-esc="o.payment_date"/>
<br/>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
<br/>
<span t-esc="fill_stars(o.check_amount_in_words)"/>
</div>
</div>
</t>
</t>
</template>

</data>
</odoo>
30 changes: 14 additions & 16 deletions l10n_us_check_writing_address/report/report_check_base_middle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<template id="report_check_base_middle">
<t t-call="report.html_container">
Expand Down Expand Up @@ -38,15 +37,15 @@
</td>
<td>
<span t-esc="line['amount_total']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td>
<span t-esc="line['residual']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td>
<span t-esc="line['paid_amount']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</t>
Expand All @@ -56,25 +55,24 @@
align="right">
<b>Check Amount:</b>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</div>
<div t-if="i==0" style="padding-top:20mm;">
<address t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}'/>
<span t-esc="o.payment_date"/>
<br/>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
<br/>
<span t-esc="fill_stars(o.check_amount_in_words)"/>
</div>
<address t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}'/>
<span t-esc="o.payment_date"/>
<br/>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<br/>
<span t-esc="fill_stars(o.check_amount_in_words)"/>
</div>
</t>
</div>
</div>
</t>
</t>
</template>

</data>
</odoo>
12 changes: 5 additions & 7 deletions l10n_us_check_writing_address/report/report_check_base_top.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<template id="report_check_base_top">
<t t-call="report.html_container">
Expand All @@ -13,7 +12,7 @@
<span t-esc="o.payment_date"/>
<br/>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<br/>
<span t-esc="fill_stars(o.check_amount_in_words)"/>
</div>
Expand Down Expand Up @@ -50,15 +49,15 @@
</td>
<td>
<span t-esc="line['amount_total']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td>
<span t-esc="line['residual']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td>
<span t-esc="line['paid_amount']"
t-esc-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</t>
Expand All @@ -68,7 +67,7 @@
align="right">
<b>Check Amount:</b>
<span t-field="o.amount"
t-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</div>
</t>
</div>
Expand All @@ -77,5 +76,4 @@
</t>
</template>

</data>
</odoo>

0 comments on commit e378024

Please sign in to comment.