Skip to content

Commit

Permalink
Fix batch print ISR
Browse files Browse the repository at this point in the history
  • Loading branch information
TDu committed Jun 26, 2018
1 parent ce2a010 commit 76157af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions l10n_ch_payment_slip/controllers/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ def report_routes(self, reportname, docids=None, converter=None, **data):
if converter == "reportlab_pdf":
report_slip = request.env.ref(
'l10n_ch_payment_slip.one_slip_per_page_from_invoice')
filename = _('ISR')
filename = ''
invoice_id = []
if docids:
invoice_id = [int(i) for i in docids.split(',')][0]
invoice_id = [int(i) for i in docids.split(',')]
filename = ''.join([
_('ISR'), '_',
'{0:05d}'.format(invoice_id), '.pdf',
_('ISR'),
'_multiple_invoices' if len(invoice_id) > 1
else '{0:05d}'.format(invoice_id[0]),
'.pdf'
])
data, format = report_slip.render(invoice_id)
pdfhttpheaders = [
Expand Down
2 changes: 1 addition & 1 deletion l10n_ch_payment_slip/static/src/js/qwebactionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var framework = require('web.framework');

ActionManager.include({
ir_actions_report: function (action, options){
var report_url;
var report_url = '';

if (action.report_type !== 'reportlab_pdf') {
return this._super(action, options);
Expand Down

0 comments on commit 76157af

Please sign in to comment.