flectra/addons/account_cash_flow/wizard/account_cash_flow.py

24 lines
784 B
Python
Raw Normal View History

2018-04-12 09:06:47 +02:00
# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import models, fields
class AccountCashFlow(models.TransientModel):
"""Credit Notes"""
2018-04-19 07:36:14 +02:00
# TODO: Add date filters
2018-04-12 09:06:47 +02:00
_inherit = "account.common.report"
_name = "account.cash.flow"
_description = "Cash Flow"
no_of_year = fields.Integer(string='Previous Period', default=0)
def _print_report(self, data):
2018-04-19 07:36:14 +02:00
data['form'].update(self.read(['no_of_year', 'company_id',
'branch_id'])[0])
2018-04-12 09:06:47 +02:00
landscape = False
if self.no_of_year > 2:
landscape = True
return self.env.ref(
'account_cash_flow.action_cash_flow_report').with_context(landscape=landscape).report_action(self, data=data)