[ADD]: Cash Flow Report.

This commit is contained in:
Kunjal 2018-04-12 12:36:47 +05:30
parent 056853fbe4
commit b0f6928355
16 changed files with 966 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from . import models
from . import wizard
from . import report

View File

@ -0,0 +1,41 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
{
'name': 'Cash Flow',
'version': '1.1',
'author': 'Flectra',
'website': 'https://flectrahq.com',
'summary': "cash flow statement",
'description': """
The cash flow statement is intended to:
1 : provide information on a firm's liquidity and solvency and its ability to change cash flows in future circumstances
2 : provide additional information for evaluating changes in assets, liabilities and equity
3 : improve the comparability of different firms' operating performance by eliminating the effects of different accounting methods
4 : indicate the amount, timing and probability of future cash flows
""",
'category': 'Sales',
'depends': ['account', 'account_invoicing'],
'data': [
'data/data_account_type.xml',
'wizard/account_cash_flow.xml',
'views/account_view.xml',
'views/account_move_line.xml',
'wizard/account_cash_flow.xml',
'report/report_menu.xml',
'report/report_account_cash_flow.xml',
],
'demo': [
],
'application': True,
}

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<record id="account.data_account_type_receivable"
model="account.account.type">
<field name="activity_type">operation_current_asset</field>
</record>
<record id="account.data_unaffected_earnings"
model="account.account.type">
<field name="activity_type">investing</field>
</record>
<record id="account.data_account_type_payable"
model="account.account.type">
<field name="activity_type">operation_current_liability</field>
</record>
<record id="account.data_account_type_current_assets"
model="account.account.type">
<field name="activity_type">operation_current_asset</field>
</record>
<record id="account.data_account_type_other_income"
model="account.account.type">
<field name="activity_type">operation_income</field>
</record>
<record id="account.data_account_type_revenue"
model="account.account.type">
<field name="activity_type">operation_income</field>
</record>
<record id="account.data_account_type_depreciation"
model="account.account.type">
<field name="activity_type">operation_expense</field>
</record>
<record id="account.data_account_type_expenses"
model="account.account.type">
<field name="activity_type">operation_expense</field>
</record>
<record id="account.data_account_type_direct_costs"
model="account.account.type">
<field name="activity_type">operation_expense</field>
</record>
<record id="account.data_account_type_current_liabilities"
model="account.account.type">
<field name="activity_type">operation_current_liability</field>
</record>
<record id="account.data_account_type_fixed_assets"
model="account.account.type">
<field name="activity_type">investing</field>
</record>
<record id="account.data_account_type_equity"
model="account.account.type">
<field name="activity_type">financing</field>
</record>
<record id="account.data_account_type_prepayments"
model="account.account.type">
<field name="activity_type">financing</field>
</record>
<record id="account.data_account_type_non_current_assets"
model="account.account.type">
<field name="activity_type">financing</field>
</record>
<record id="account.data_account_type_non_current_liabilities"
model="account.account.type">
<field name="activity_type">financing</field>
</record>
</data>
</flectra>

View File

@ -0,0 +1,243 @@
# Translation of Flectra Server.
# This file contains the translation of the following modules:
# * cash_flow
#
msgid ""
msgstr ""
"Project-Id-Version: Flectra Server 1.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-06 05:23+0000\n"
"PO-Revision-Date: 2018-04-06 05:23+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Financing Activities\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Investing Activities\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Bank\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Cash\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Operating\n"
" Activities\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;\">\n"
" Operating + Financing +\n"
" Investing\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:20px;\">\n"
" Part\n"
" A\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:20px;\">\n"
" Part\n"
" B\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:20px;\">\n"
" Total of (A + B)\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Current Assets\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Current Liabilities\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Expense\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Income\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Total\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "<span style=\"font-weight:bold;padding-left:40px;\">\n"
" Total\n"
" </span>"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "Account"
msgstr ""
#. module: cash_flow
#: model:ir.model,name:cash_flow.model_account_account_type
msgid "Account Type"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_account_type_activity_type
#: model:ir.model.fields,field_description:cash_flow.field_account_move_line_activity_type
msgid "Activity Type"
msgstr ""
#. module: cash_flow
#: model:ir.actions.act_window,name:cash_flow.action_account_cash_flow
#: model:ir.model,name:cash_flow.model_account_cash_flow
#: model:ir.ui.menu,name:cash_flow.menu_cash_flow_report
msgid "Cash Flow"
msgstr ""
#. module: cash_flow
#: model:ir.actions.report,name:cash_flow.action_cash_flow_report
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "Cash Flow Statement"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_create_uid
msgid "Created by"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_create_date
msgid "Created on"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_display_name
#: model:ir.model.fields,field_description:cash_flow.field_report_cash_flow_report_account_cash_flow_display_name
msgid "Display Name"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Financing"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_id
#: model:ir.model.fields,field_description:cash_flow.field_report_cash_flow_report_account_cash_flow_id
msgid "ID"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Investing"
msgstr ""
#. module: cash_flow
#: model:ir.model,name:cash_flow.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow___last_update
#: model:ir.model.fields,field_description:cash_flow.field_report_cash_flow_report_account_cash_flow___last_update
msgid "Last Modified on"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_write_uid
msgid "Last Updated by"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_write_date
msgid "Last Updated on"
msgstr ""
#. module: cash_flow
#: model:ir.model.fields,field_description:cash_flow.field_account_cash_flow_no_of_year
msgid "Number of years"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Operation-Current Asset"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Operation-Cuurent Liability"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Operation-Expense"
msgstr ""
#. module: cash_flow
#: selection:account.account.type,activity_type:0
msgid "Operation-Income"
msgstr ""
#. module: cash_flow
#: model:ir.model,name:cash_flow.model_report_cash_flow_report_account_cash_flow
msgid "report.cash_flow.report_account_cash_flow"
msgstr ""
#. module: cash_flow
#: model:ir.ui.view,arch_db:cash_flow.report_account_cash_flow
msgid "upto"
msgstr ""

View File

@ -0,0 +1,4 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from . import account
from . import account_move_line

View File

@ -0,0 +1,15 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import fields, models
class Account(models.Model):
_inherit = 'account.account.type'
activity_type = fields.Selection(
[('operation_income', 'Operation-Income'),
('operation_expense', 'Operation-Expense'),
('operation_current_asset', 'Operation-Current Asset'),
('operation_current_liability', 'Operation-Cuurent Liability'),
('investing', 'Investing'),
('financing', 'Financing')], string='Activity Type')

View File

@ -0,0 +1,9 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import fields, models
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
activity_type = fields.Selection(related='user_type_id.activity_type')

View File

@ -0,0 +1,3 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from . import report_account_cash_flow

View File

@ -0,0 +1,106 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import models, api
import datetime
from datetime import timedelta
import calendar
from collections import Counter
class ReportAccountCashFlow(models.AbstractModel):
_name = 'report.account_cash_flow.report_account_cash_flow'
def get_years(self, data, is_getdata):
company_id = self.env['res.company'].browse(
data['form']['company_id'][0])
date_dict = {}
year_list = [datetime.datetime.now().year - year for year in
range(0, data['form']['no_of_year'] + 1)]
for year in year_list:
no_days = calendar.isleap(year) and 365 or 364
date_dict.update({year: [
str(datetime.date(year, company_id.fiscalyear_last_month,
company_id.fiscalyear_last_day) -
timedelta(days=no_days)),
str(datetime.date(year, company_id.fiscalyear_last_month,
company_id.fiscalyear_last_day))]})
year_list.sort(reverse=True)
if is_getdata:
return date_dict
return year_list
def get_move_lines(self, date_from, date_to, key, dummy_list):
self._cr.execute("select CASE WHEN acc_type.activity_type is null THEN acc.name ELSE acc_type.activity_type END AS activity_type, "
"aml.account_id, "
"(sum(aml.debit) - sum(aml.credit)) * -1 as "
"balance "
"from account_move_line aml, "
"account_account acc, "
"account_account_type acc_type "
"where acc.id = aml.account_id and "
"aml.date >= '%s'" % date_from + "and "
"aml.date <= '%s'" % date_to + "and "
"acc.user_type_id = acc_type.id "
"group by aml.account_id, "
"acc_type.activity_type, acc.name")
balance_data = self._cr.dictfetchall()
[d.update({'year': {key: d['balance']}}) for d in balance_data]
for dummy in dummy_list:
[d['year'].update({dummy: 0.0}) for d in balance_data]
return balance_data
def get_data(self, data):
final_dict = {}
balance_data = []
date_dict = self.get_years(data, is_getdata=True)
for key in sorted(date_dict, reverse=True):
dummy_list = list(date_dict.keys())
dummy_list.remove(key)
balance_data += self.get_move_lines(date_dict[key][0],
date_dict[key][1], key, dummy_list)
for data in balance_data:
if data['activity_type'] not in final_dict:
final_dict[data['activity_type']] = {'account': {}}
final_dict[data['activity_type']]['account'] = {data['account_id']: data['year']}
final_dict[data['activity_type']]['total'] = data['year']
else:
if data['account_id'] not in \
final_dict[data['activity_type']]['account']:
final_dict[data['activity_type']]['account'][data['account_id']] = data['year']
else:
f_year = final_dict[data['activity_type']]['account'][data['account_id']]
d_year = data['year']
total = {k : f_year.get(k, 0) + d_year.get(k,0) for k in set(f_year.keys()) | set(d_year.keys())}
final_dict[data['activity_type']]['account'][data['account_id']] = total
y_total = final_dict[data['activity_type']]['total']
total = {k : y_total.get(k, 0) + data['year'].get(k,0) for k in set(y_total.keys()) | set(data['year'].keys())}
final_dict[data['activity_type']]['total'] = total
return final_dict
def get_acc_details(self, account_id):
acc_details = {'ac_nm': self.env['account.account'].browse(
account_id).name,
'ac_no': self.env['account.account'].browse(
account_id).code}
return acc_details
def get_total(self, data_dict, year, type_list):
total_bal = 0.00
for value in type_list:
if value in data_dict:
total_bal += data_dict[value]['total'][year]
return total_bal
@api.model
def get_report_values(self, docids, data=None):
docs = self.env['account.move.line'].browse(docids)
docargs = {
'doc_model': 'account.move.line',
'docs': docs,
'get_data': self.get_data(data),
'get_years': self.get_years(data, is_getdata=False),
'get_acc_details': self.get_acc_details,
'get_total': self.get_total,
}
return docargs

View File

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<template id="report_account_cash_flow">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page">
<h3 style="text-align:center">Cash Flow Statement
</h3>
<p style="text-align:center;margin-top: -10px;">upto
<span t-esc="datetime.datetime.now().strftime('%Y-%m-%d')"
t-options="{'widget': 'date'}"/>
</p>
<div class="row">
<table class="table-condensed" width="100%">
<thead>
<tr>
<td><font color="white">........</font></td>
<t t-foreach="get_years" t-as="year">
<td class="text-right"><b><t t-esc="year"/></b></td>
</t>
</tr>
</thead>
<tbody>
<tr>
<td>
<span style="font-weight:bold;">
Operating
Activities
</span>
</td>
</tr>
<tr>
<td>
<span
style="font-weight:bold;padding-left:20px;">
Part
A
</span>
</td>
</tr>
<t
t-if="get_data.get('operation_income', False)">
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Income
</span>
</td>
</tr>
<tr t-foreach="get_data['operation_income']['account']"
t-as="account">
<td style="padding-left:70px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span t-att-style="style"
t-esc="get_data['operation_income']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
</t>
<t t-if="get_data.get('operation_expense', False)">
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Expense
</span>
</td>
</tr>
<tr t-foreach="get_data['operation_expense']['account']"
t-as="account">
<td style="padding-left:70px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span
t-esc="get_data['operation_expense']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
</t>
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Total
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span
style="font-weight:bold"
t-esc="get_total(get_data, year, ['operation_income', 'operation_expense'])"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
<tr>
<td>
<span
style="font-weight:bold;padding-left:20px;">
Part
B
</span>
</td>
</tr>
<t t-if="get_data.get('operation_current_asset', False)">
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Current Assets
</span>
</td>
</tr>
<tr t-foreach="get_data['operation_current_asset']['account']"
t-as="account">
<td style="padding-left:70px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span t-att-style="style"
t-esc="get_data['operation_current_asset']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
</t>
<t t-if="get_data.get('operation_current_liability', False)">
<tr>
<td>
<span style="font-weight:bold;padding-left:40px;">
Current Liabilities
</span>
</td>
</tr>
<tr t-foreach="get_data['operation_current_liability']['account']"
t-as="account">
<td style="padding-left:70px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span t-att-style="style"
t-esc="get_data['operation_current_liability']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
</t>
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Total
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span style="font-weight:bold;"
t-esc="get_total(get_data, year, ['operation_current_asset', 'operation_current_liability'])"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
<tr>
<td>
<span
style="font-weight:bold;padding-left:20px;">
Total of (A + B)
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span style="font-weight:bold;"
t-esc="get_total(get_data, year, ['operation_current_asset', 'operation_current_liability', 'operation_income', 'operation_expense'])"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
<t t-if="get_data.get('investing', False)">
<tr>
<td>
<span style="font-weight:bold;">
Investing Activities
</span>
</td>
</tr>
<tr t-foreach="get_data['investing']['account']"
t-as="account">
<td style="padding-left:40px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span t-att-style="style"
t-esc="get_data['investing']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
<tr>
<td>
<span style="font-weight:bold;padding-left:40px;">
Total
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span style="font-weight:bold;"
t-esc="get_data['investing']['total'][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
</t>
<t t-if="get_data.get('financing', False)">
<tr>
<td>
<span style="font-weight:bold;">
Financing Activities
</span>
</td>
</tr>
<tr t-foreach="get_data['financing']['account']"
t-as="account">
<td style="padding-left:40px">
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_no']"/>
<span t-att-style="style"
t-esc="get_acc_details(account)['ac_nm']"/>
</td>
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span t-att-style="style"
t-esc="get_data['financing']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</tr>
<tr>
<td>
<span
style="font-weight:bold;padding-left:40px;">
Total
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span style="font-weight:bold;"
t-esc="get_data['financing']['total'][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
</t>
<tr>
<td>
<span style="font-weight:bold;">
Operating + Financing +
Investing
</span>
</td>
<td t-foreach="get_years"
t-as="year" class="text-right">
<span style="font-weight:bold;"
t-esc="get_total(get_data, year, ['operation_current_asset', 'operation_current_liability', 'operation_income', 'operation_expense', 'financing', 'investing'])"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</tr>
<tr t-if="get_data.get('Cash',False)">
<td>
<span style="font-weight:bold;">
Cash
</span>
</td>
<t t-foreach="get_data['Cash']['account']"
t-as="account">
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span style="font-weight:bold;"
t-esc="get_data['Cash']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</t>
</tr>
<tr
t-if="get_data.get('Bank',False)">
<td>
<span
style="font-weight:bold;">
Bank
</span>
</td>
<t t-foreach="get_data['Bank']['account']"
t-as="account">
<t t-foreach="get_years"
t-as="year">
<td class="text-right">
<span style="font-weight:bold;"
t-esc="get_data['Bank']['account'][account][year]"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
</t>
</t>
</tr>
</tbody>
</table>
</div>
</div>
</t>
</t>
</template>
</flectra>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="paperformat_cashflow_report" model="report.paperformat">
<field name="name">Cash flow report paperformat</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">15</field>
<field name="margin_bottom">5</field>
<field name="margin_left">7</field>
<field name="margin_right">7</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">10</field>
<field name="dpi">70</field>
</record>
<report
id="action_cash_flow_report"
model="account.move.line"
string="Cash Flow Statement"
report_type="qweb-pdf"
name="account_cash_flow.report_account_cash_flow"
file="account_cash_flow.report_account_cash_flow"
menu="False"
paperformat="paperformat_cashflow_report"
/>
</flectra>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="view_move_line_form_inherit" model="ir.ui.view">
<field name="name">account.move.line.form.inherit</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='move_id']" position="before">
<field name="activity_type"/>
</xpath>
</field>
</record>
</flectra>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="view_account_type_form_inherit" model="ir.ui.view">
<field name="name">account.account.type.form.inherit</field>
<field name="model">account.account.type</field>
<field name="inherit_id" ref="account.view_account_type_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='type']" position="after">
<field name="activity_type"/>
</xpath>
</field>
</record>
</flectra>

View File

@ -0,0 +1,3 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from . import account_cash_flow

View File

@ -0,0 +1,21 @@
# Part of Flectra See LICENSE file for full copyright and licensing details.
from flectra import models, fields
class AccountCashFlow(models.TransientModel):
"""Credit Notes"""
_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'])[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)

View File

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<flectra>
<record id="view_account_cash_flow_from" model="ir.ui.view">
<field name="name">account.cash.flow.form</field>
<field name="model">account.cash.flow</field>
<field name="inherit_id" ref="account.account_common_report_view"/>
<field name="arch" type="xml">
<field name="journal_ids" position="replace"/>
<xpath expr="//field[@name='date_from']" position="before">
<field name="no_of_year"/>
<field name="company_id"/>
</xpath>
<xpath expr="//field[@name='date_from']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='date_to']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<record model="ir.actions.act_window" id="action_account_cash_flow">
<field name="name">Cash Flow</field>
<field name="res_model">account.cash.flow</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_cash_flow_from" />
<field name="context">{}</field>
<field name="target">new</field>
</record>
<menuitem id="menu_cash_flow_report" name="Cash Flow"
parent="account.menu_finance_legal_statement"
action="account_cash_flow.action_account_cash_flow"/>
</flectra>