Skip to content

Commit

Permalink
[ADD] account_liquidity_forecast
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Apr 26, 2024
1 parent 358e77f commit 7c618f7
Show file tree
Hide file tree
Showing 30 changed files with 1,914 additions and 0 deletions.
77 changes: 77 additions & 0 deletions account_liquidity_forecast/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
==========================
Account Liquidity Forecast
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f78bdd3e795ab416bb2075f5ea9844afeedca1ccb309f75ce86d1105f08b172f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-reporting/tree/16.0/account_liquidity_forecast
:alt: OCA/account-financial-reporting
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-account_liquidity_forecast
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|


**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20account_liquidity_forecast%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* ForgeFlow

Contributors
~~~~~~~~~~~~

* `ForgeFlow <https://www.forgeflow.com>`__:

* Jordi Ballester

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/16.0/account_liquidity_forecast>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions account_liquidity_forecast/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import report
from . import wizards
31 changes: 31 additions & 0 deletions account_liquidity_forecast/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
{
"name": "Account Liquidity Forecast",
"version": "16.0.1.0.0",
"category": "Reporting",
"summary": "Account Liquidity Forecast",
"author": "ForgeFlow," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-reporting",
"depends": ["account"],
"data": [
"security/ir.model.access.csv",
"security/security.xml",
"wizards/account_liquidity_forecast_wizard_views.xml",
"views/report_liquidity_forecast_views.xml",
"views/account_liquidity_forecast_planning_item_views.xml",
"views/account_liquidity_forecast_planning_group_views.xml",
"menuitems.xml",
"reports.xml",
"report/templates/layouts.xml",
"report/templates/liquidity_forecast.xml",
],
"assets": {
"web.assets_backend": [
"account_liquidity_forecast/static/src/js/*",
],
},
"installable": True,
"application": True,
"auto_install": False,
"license": "AGPL-3",
}
26 changes: 26 additions & 0 deletions account_liquidity_forecast/menuitems.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<menuitem
parent="account.menu_finance_reports"
id="menu_liquidity_forecast"
action="action_liquidity_forecast_wizard"
name="Liquidity Forecast"
groups="account.group_account_user"
/>

<menuitem
name="Liquidity Forecast Planning Groups"
id="account_liquidity_forecast_planning_group_menu"
parent="account.account_account_menu"
action="account_liquidity_forecast_planning_group_action"
groups="account.group_account_manager"
/>
<menuitem
name="Liquidity Forecast Planning Items"
id="account_liquidity_forecast_planning_item_menu"
parent="account.menu_finance_entries_management"
action="account_liquidity_forecast_planning_item_action"
groups="account.group_account_user"
/>

</odoo>
3 changes: 3 additions & 0 deletions account_liquidity_forecast/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import ir_actions_report
from . import account_liquidity_forecast_planning_group
from . import account_liquidity_forecast_planning_item
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class AccountLiquidityForecastPlanningGroup(models.Model):
_name = "account.liquidity.forecast.planning.group"
_description = "Liquidity Forecast Planning Group"

name = fields.Char(required=True, translate=True)
company_id = fields.Many2one(
"res.company",
string="Company",
required=True,
default=lambda self: self.env.company,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class AccountLiquidityForecastPlanningItem(models.Model):
_name = "account.liquidity.forecast.planning.item"
_description = "Liquidity Forecast Planning Item"

name = fields.Char(required=True)
group_id = fields.Many2one(
string="Planning Group",
comodel_name="account.liquidity.forecast.planning.group",
)
company_id = fields.Many2one(
"res.company",
string="Company",
required=True,
default=lambda self: self.env.company,
index=True,
)
company_currency_id = fields.Many2one(
string="Company Currency",
related="company_id.currency_id",
readonly=True,
store=True,
precompute=True,
)
amount = fields.Monetary(currency_field="company_currency_id")
direction = fields.Selection(
selection=[("in", "Incoming"), ("out", "Outgoing")],
default="in",
index=True,
)
date = fields.Date(index=True)
expiry_date = fields.Date(index=True)
27 changes: 27 additions & 0 deletions account_liquidity_forecast/models/ir_actions_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models


class IrActionsReport(models.Model):
_inherit = "ir.actions.report"

@api.model
def _prepare_liquidity_forecast_report_context(self, data):
lang = data and data.get("liquidity_forecast_report_lang") or ""
return dict(self.env.context or {}, lang=lang) if lang else False

@api.model
def _render_qweb_html(self, report_ref, docids, data=None):
context = self._prepare_liquidity_forecast_report_context(data)
obj = self.with_context(**context) if context else self
return super(IrActionsReport, obj)._render_qweb_html(
report_ref, docids, data=data
)

@api.model
def _render_xlsx(self, report_ref, docids, data=None):
context = self._prepare_liquidity_forecast_report_context(data)
obj = self.with_context(**context) if context else self
return super(IrActionsReport, obj)._render_xlsx(report_ref, docids, data=data)
3 changes: 3 additions & 0 deletions account_liquidity_forecast/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `ForgeFlow <https://www.forgeflow.com>`__:

* Jordi Ballester
Empty file.
1 change: 1 addition & 0 deletions account_liquidity_forecast/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import liquidity_forecast
Loading

0 comments on commit 7c618f7

Please sign in to comment.