flectra/addons/account_cash_flow/wizard/account_cash_flow.py
2018-04-19 14:29:27 +05:30

24 lines
784 B
Python

# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import models, fields
class AccountCashFlow(models.TransientModel):
"""Credit Notes"""
# TODO: Add date filters
_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):
data['form'].update(self.read(['no_of_year', 'company_id',
'branch_id'])[0])
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)