[IMP] mis_builder_cash_flow: Consider states according selection

"Target Moves" option in MIS report instance was previously ignored.

Now it's taken into account, but still excluding cancelled entries.
pull/1049/head
Pedro M. Baeza 2021-07-07 18:24:47 +02:00 committed by Stefan
parent ccda3c136c
commit 5ac0d4aff2
15 changed files with 125 additions and 7 deletions

View File

@ -43,6 +43,10 @@ To use this module, you need to:
#. Go to Accounting > Reports > MIS Reporting > MIS Reports and choose "Cash Flow" report
#. You can add forecast lines on Accounting > Reports > MIS Reporting > Cash Flow Forecast Line
#. If you select on "Target Moves" the value "All Posted Entries", you will get only
lines for already posted invoices/entries + the forecast lines.
#. Selecting "All Entries", draft invoices/entries are also included.
#. In any case, cancelled invoices/entries are not included.
Known issues / Roadmap
======================
@ -75,6 +79,9 @@ Contributors
* Juan José Scarafía <jjs@adhoc.com.ar>
* Gonzalo Ruzafa <gr@adhoc.com.ar>
* Alberto Martín <alberto.martin@guadaltech.es>
* `Tecnativa <https://www.tecnativa.com>`_:
* Pedro M. Baeza
Maintainers
~~~~~~~~~~~

View File

@ -1,9 +1,10 @@
# Copyright 2019 ADHOC SA
# Copyright 2021 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "MIS Builder Cash Flow",
"version": "13.0.1.0.0",
"version": "13.0.1.1.0",
"license": "LGPL-3",
"author": "ADHOC SA, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mis-builder",

View File

@ -215,6 +215,11 @@ msgstr ""
msgid "MIS Cash Flow Forecast Line"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -263,6 +268,11 @@ msgstr ""
msgid "Reconciled"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""

View File

@ -215,6 +215,11 @@ msgstr ""
msgid "MIS Cash Flow Forecast Line"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -263,6 +268,11 @@ msgstr ""
msgid "Reconciled"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""

View File

@ -226,6 +226,11 @@ msgstr "Flujo de Caja MIS"
msgid "MIS Cash Flow Forecast Line"
msgstr "Línea de previsión de flujo de caja MIS"
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -275,6 +280,11 @@ msgstr "Empresa"
msgid "Reconciled"
msgstr "Conciliado"
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""

View File

@ -217,6 +217,11 @@ msgstr "Flujo de Efectivo MIS"
msgid "MIS Cash Flow Forecast Line"
msgstr "Línea de Pronóstico del Flujo de Efectivo MIS"
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -265,12 +270,17 @@ msgstr "Socio"
msgid "Reconciled"
msgstr "Reconciliado"
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""
"The 'Internal Type' is used for features available on different types of "
"accounts: liquidity type is for cash or bank accounts, payable/receivable is"
" for vendor/customer accounts."
"accounts: liquidity type is for cash or bank accounts, payable/receivable is "
"for vendor/customer accounts."
msgstr ""
"El 'Tipo Interno' se utiliza para las funciones disponibles en diferentes "
"tipos de cuentas: el tipo de liquidez es para efectivo o cuentas bancarias, "

View File

@ -214,6 +214,11 @@ msgstr ""
msgid "MIS Cash Flow Forecast Line"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -262,6 +267,11 @@ msgstr ""
msgid "Reconciled"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""

View File

@ -217,6 +217,11 @@ msgstr ""
msgid "MIS Cash Flow Forecast Line"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -265,12 +270,17 @@ msgstr "Partner"
msgid "Reconciled"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""
"The 'Internal Type' is used for features available on different types of "
"accounts: liquidity type is for cash or bank accounts, payable/receivable is"
" for vendor/customer accounts."
"accounts: liquidity type is for cash or bank accounts, payable/receivable is "
"for vendor/customer accounts."
msgstr ""
#. module: mis_builder_cash_flow

View File

@ -217,6 +217,11 @@ msgstr "Fluxo de Tesouraria MIS"
msgid "MIS Cash Flow Forecast Line"
msgstr "Linha de Previsão de Fluxo de Tesouraria MIS"
#. module: mis_builder_cash_flow
#: model:ir.model,name:mis_builder_cash_flow.model_mis_report_instance_period
msgid "MIS Report Instance Period"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__full_reconcile_id
msgid "Matching Number"
@ -265,6 +270,11 @@ msgstr "Parceiro"
msgid "Reconciled"
msgstr "Reconciliado"
#. module: mis_builder_cash_flow
#: model:ir.model.fields,field_description:mis_builder_cash_flow.field_mis_cash_flow__state
msgid "State"
msgstr ""
#. module: mis_builder_cash_flow
#: model:ir.model.fields,help:mis_builder_cash_flow.field_mis_cash_flow__account_internal_type
msgid ""

View File

@ -1,4 +1,4 @@
# Copyright 2019 ADHOC SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import mis_cash_flow_forecast_line
from . import account_account
from . import mis_cash_flow_forecast_line
from . import mis_report_instance

View File

@ -0,0 +1,17 @@
# Copyright 2021 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class MisReportInstancePeriod(models.Model):
_inherit = "mis.report.instance.period"
def _get_additional_move_line_filter(self):
"""Add the posted condition ."""
domain = super()._get_additional_move_line_filter()
if (
self._get_aml_model_name() == "mis.cash_flow"
and self.report_instance_id.target_move == "posted"
):
domain += [("state", "=", "posted")]
return domain

View File

@ -1,3 +1,6 @@
* Juan José Scarafía <jjs@adhoc.com.ar>
* Gonzalo Ruzafa <gr@adhoc.com.ar>
* Alberto Martín <alberto.martin@guadaltech.es>
* `Tecnativa <https://www.tecnativa.com>`_:
* Pedro M. Baeza

View File

@ -2,3 +2,7 @@ To use this module, you need to:
#. Go to Accounting > Reports > MIS Reporting > MIS Reports and choose "Cash Flow" report
#. You can add forecast lines on Accounting > Reports > MIS Reporting > Cash Flow Forecast Line
#. If you select on "Target Moves" the value "All Posted Entries", you will get only
lines for already posted invoices/entries + the forecast lines.
#. Selecting "All Entries", draft invoices/entries are also included.
#. In any case, cancelled invoices/entries are not included.

View File

@ -50,6 +50,12 @@ class MisCashFlow(models.Model):
account_internal_type = fields.Selection(
related="account_id.user_type_id.type", readonly=True
)
state = fields.Selection(selection="_selection_parent_state",)
def _selection_parent_state(self):
return self.env["account.move"].fields_get(allfields=["state"])["state"][
"selection"
]
def init(self):
query = """
@ -75,6 +81,7 @@ class MisCashFlow(models.Model):
aml.partner_id as partner_id,
aml.company_id as company_id,
aml.name as name,
aml.parent_state as state,
COALESCE(aml.date_maturity, aml.date) as date
FROM account_move_line as aml
WHERE aml.parent_state != 'cancel'
@ -99,6 +106,7 @@ class MisCashFlow(models.Model):
fl.partner_id as partner_id,
fl.company_id as company_id,
fl.name as name,
'posted' as state,
fl.date as date
FROM mis_cash_flow_forecast_line as fl
"""

View File

@ -394,6 +394,10 @@ The forecast is based on two types of date:</p>
<ol class="arabic simple">
<li>Go to Accounting &gt; Reports &gt; MIS Reporting &gt; MIS Reports and choose “Cash Flow” report</li>
<li>You can add forecast lines on Accounting &gt; Reports &gt; MIS Reporting &gt; Cash Flow Forecast Line</li>
<li>If you select on “Target Moves” the value “All Posted Entries”, you will get only
lines for already posted invoices/entries + the forecast lines.</li>
<li>Selecting “All Entries”, draft invoices/entries are also included.</li>
<li>In any case, cancelled invoices/entries are not included.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
@ -424,6 +428,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Juan José Scarafía &lt;<a class="reference external" href="mailto:jjs&#64;adhoc.com.ar">jjs&#64;adhoc.com.ar</a>&gt;</li>
<li>Gonzalo Ruzafa &lt;<a class="reference external" href="mailto:gr&#64;adhoc.com.ar">gr&#64;adhoc.com.ar</a>&gt;</li>
<li>Alberto Martín &lt;<a class="reference external" href="mailto:alberto.martin&#64;guadaltech.es">alberto.martin&#64;guadaltech.es</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Pedro M. Baeza</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">