report begonnen
This commit is contained in:
parent
810ecea0ba
commit
70038eb15e
6 changed files with 312 additions and 2 deletions
36
cbreport.py
Normal file
36
cbreport.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This file is part of the cashbook-module from m-ds for Tryton.
|
||||
# The COPYRIGHT file at the top level of this repository contains the
|
||||
# full copyright notices and license terms.
|
||||
|
||||
from trytond.report import Report
|
||||
from trytond.i18n import gettext
|
||||
from slugify import slugify
|
||||
|
||||
|
||||
class CashbookReport(Report):
|
||||
__name__ = 'cashbook.repbook'
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
""" edit filename
|
||||
"""
|
||||
pool = Pool()
|
||||
IrDate = pool.get('ir.date')
|
||||
ExpObj = pool.get(data['model'])(data['id'])
|
||||
|
||||
(ext1, cont1, dirprint, title) = super(CashbookReport, cls).execute(ids, data)
|
||||
|
||||
return (
|
||||
ext1,
|
||||
cont1,
|
||||
dirprint,
|
||||
slugify('%(date)s-%(book)s-%(descr)s' % {
|
||||
'date': IrDate.today().isoformat().replace('-', ''),
|
||||
'book': gettext('cashbook.msg_name_cashbook'),
|
||||
'descr': ExpObj.name[:15],
|
||||
},
|
||||
max_length=75, word_boundary=True, save_order=True),
|
||||
)
|
||||
|
||||
# end CashbookReport
|
Loading…
Add table
Add a link
Reference in a new issue