diff --git a/mis_builder_cash_flow/__manifest__.py b/mis_builder_cash_flow/__manifest__.py
index 3d7a804a..7e872274 100644
--- a/mis_builder_cash_flow/__manifest__.py
+++ b/mis_builder_cash_flow/__manifest__.py
@@ -2,25 +2,22 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
- 'name': 'MIS Builder Cash Flow',
- 'version': '12.0.1.3.0',
- 'license': 'LGPL-3',
- 'author': 'ADHOC SA, '
- 'Odoo Community Association (OCA)',
- 'website': 'https://github.com/OCA/mis-builder',
- 'depends': [
- 'mis_builder',
+ "name": "MIS Builder Cash Flow",
+ "version": "12.0.1.3.0",
+ "license": "LGPL-3",
+ "author": "ADHOC SA, " "Odoo Community Association (OCA)",
+ "website": "https://github.com/OCA/mis-builder",
+ "depends": ["mis_builder",],
+ "data": [
+ "security/mis_cash_flow_security.xml",
+ "report/mis_cash_flow_views.xml",
+ "views/mis_cash_flow_forecast_line_views.xml",
+ "views/account_account_views.xml",
+ "data/mis_report_style.xml",
+ "data/mis_report.xml",
+ "data/mis_report_instance.xml",
],
- 'data': [
- 'security/mis_cash_flow_security.xml',
- 'report/mis_cash_flow_views.xml',
- 'views/mis_cash_flow_forecast_line_views.xml',
- 'views/account_account_views.xml',
- 'data/mis_report_style.xml',
- 'data/mis_report.xml',
- 'data/mis_report_instance.xml',
- ],
- 'installable': True,
- 'maintainers': ['jjscarafia'],
- 'development_status': 'Beta',
+ "installable": True,
+ "maintainers": ["jjscarafia"],
+ "development_status": "Beta",
}
diff --git a/mis_builder_cash_flow/data/mis_report.xml b/mis_builder_cash_flow/data/mis_report.xml
index c818ef14..74222d3e 100644
--- a/mis_builder_cash_flow/data/mis_report.xml
+++ b/mis_builder_cash_flow/data/mis_report.xml
@@ -1,105 +1,109 @@
-
+
-
-
-
- Cash Flow
-
-
-
-
-
- liquidity
- LIQUIDITY
-
-
-
- 20
- bal[][('account_id.internal_type', '=', 'liquidity'), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
-
-
-
-
- in_total
- IN TOTAL
-
- 30
- in_receivable + in_forecast
-
-
-
-
- in_receivable
- In receivable
-
-
-
- 50
- bal[][('account_id.internal_type', '=', 'receivable'), ('full_reconcile_id', '=', False), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
-
-
-
-
- in_forecast
- In forecast
-
-
-
- 70
- bal[][('line_type', '=', 'forecast_line'), ('debit', '!=', 0.0), ('account_id.hide_in_cash_flow', '=', False)]
-
-
-
-
- out_total
- OUT TOTAL
-
- 80
- out_payable + out_forecast
-
-
-
-
- out_payable
- Out payable
-
-
-
- 100
- bal[][('account_id.internal_type', '=', 'payable'), ('full_reconcile_id', '=', False), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
-
-
-
-
- out_forecast
- Out forecast
-
-
-
- 120
- bal[][('line_type', '=', 'forecast_line'), ('credit', '!=', 0.0), ('account_id.hide_in_cash_flow', '=', False)]
-
-
-
-
- period_balance
- PERIOD BALANCE
-
- 130
- in_total + out_total
- 'Cash Flow - Good' if period_balance >= 0.0 else 'Cash Flow - Bad'
-
-
-
-
- balance
- BALANCE
-
- 150
- bale[][('account_id.hide_in_cash_flow', '=', False), '|', ('line_type', '=', 'forecast_line'), ('line_type', '=', 'move_line'), '|', ('account_id.internal_type', '=', 'liquidity'), ('account_id.internal_type', 'in', ('receivable', 'payable')), ('full_reconcile_id', '=', False)]
- 'Cash Flow - Good' if balance >= 0.0 else 'Cash Flow - Bad'
-
-
+
+ Cash Flow
+
+
+
+
+ liquidity
+ LIQUIDITY
+
+
+
+ 20
+ bal[][('account_id.internal_type', '=', 'liquidity'), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
+
+
+
+ in_total
+ IN TOTAL
+
+ 30
+ in_receivable + in_forecast
+
+
+
+ in_receivable
+ In receivable
+
+
+
+ 50
+ bal[][('account_id.internal_type', '=', 'receivable'), ('full_reconcile_id', '=', False), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
+
+
+
+ in_forecast
+ In forecast
+
+
+
+ 70
+ bal[][('line_type', '=', 'forecast_line'), ('debit', '!=', 0.0), ('account_id.hide_in_cash_flow', '=', False)]
+
+
+
+ out_total
+ OUT TOTAL
+
+ 80
+ out_payable + out_forecast
+
+
+
+ out_payable
+ Out payable
+
+
+
+ 100
+ bal[][('account_id.internal_type', '=', 'payable'), ('full_reconcile_id', '=', False), ('line_type', '=', 'move_line'), ('account_id.hide_in_cash_flow', '=', False)]
+
+
+
+ out_forecast
+ Out forecast
+
+
+
+ 120
+ bal[][('line_type', '=', 'forecast_line'), ('credit', '!=', 0.0), ('account_id.hide_in_cash_flow', '=', False)]
+
+
+
+ period_balance
+ PERIOD BALANCE
+
+ 130
+ in_total + out_total
+ 'Cash Flow - Good' if period_balance >= 0.0 else 'Cash Flow - Bad'
+
+
+
+ balance
+ BALANCE
+
+ 150
+ bale[][('account_id.hide_in_cash_flow', '=', False), '|', ('line_type', '=', 'forecast_line'), ('line_type', '=', 'move_line'), '|', ('account_id.internal_type', '=', 'liquidity'), ('account_id.internal_type', 'in', ('receivable', 'payable')), ('full_reconcile_id', '=', False)]
+ 'Cash Flow - Good' if balance >= 0.0 else 'Cash Flow - Bad'
+
diff --git a/mis_builder_cash_flow/data/mis_report_instance.xml b/mis_builder_cash_flow/data/mis_report_instance.xml
index 2089bb82..93a2b6fa 100644
--- a/mis_builder_cash_flow/data/mis_report_instance.xml
+++ b/mis_builder_cash_flow/data/mis_report_instance.xml
@@ -1,146 +1,132 @@
-
+
-
-
-
- Cash Flow
-
-
-
-
-
-
- Current
-
- actuals_alt
-
- relative
- w
- -4000
- 4001
- 4
-
-
-
- +1w
-
- actuals_alt
-
- relative
- w
- 1
- 1
- 10
-
-
-
- +2w
-
- actuals_alt
-
- relative
- w
- 2
- 1
- 20
-
-
-
- +3w
-
- actuals_alt
-
- relative
- w
- 3
- 1
- 30
-
-
-
- +4w
-
- actuals_alt
-
- relative
- w
- 4
- 1
- 40
-
-
-
- +5w
-
- actuals_alt
-
- relative
- w
- 5
- 1
- 50
-
-
-
- +6w
-
- actuals_alt
-
- relative
- w
- 6
- 1
- 60
-
-
-
- +7w
-
- actuals_alt
-
- relative
- w
- 7
- 1
- 70
-
-
-
- +8w
-
- actuals_alt
-
- relative
- w
- 8
- 1
- 80
-
-
-
- third month
-
- actuals_alt
-
- relative
- w
- 9
- 4
- 90
-
-
-
- fourth month
-
- actuals_alt
-
- relative
- w
- 13
- 4
- 90
-
-
+
+ Cash Flow
+
+
+
+
+
+ Current
+
+ actuals_alt
+
+ relative
+ w
+ -4000
+ 4001
+ 4
+
+
+ +1w
+
+ actuals_alt
+
+ relative
+ w
+ 1
+ 1
+ 10
+
+
+ +2w
+
+ actuals_alt
+
+ relative
+ w
+ 2
+ 1
+ 20
+
+
+ +3w
+
+ actuals_alt
+
+ relative
+ w
+ 3
+ 1
+ 30
+
+
+ +4w
+
+ actuals_alt
+
+ relative
+ w
+ 4
+ 1
+ 40
+
+
+ +5w
+
+ actuals_alt
+
+ relative
+ w
+ 5
+ 1
+ 50
+
+
+ +6w
+
+ actuals_alt
+
+ relative
+ w
+ 6
+ 1
+ 60
+
+
+ +7w
+
+ actuals_alt
+
+ relative
+ w
+ 7
+ 1
+ 70
+
+
+ +8w
+
+ actuals_alt
+
+ relative
+ w
+ 8
+ 1
+ 80
+
+
+ third month
+
+ actuals_alt
+
+ relative
+ w
+ 9
+ 4
+ 90
+
+
+ fourth month
+
+ actuals_alt
+
+ relative
+ w
+ 13
+ 4
+ 90
+
diff --git a/mis_builder_cash_flow/data/mis_report_style.xml b/mis_builder_cash_flow/data/mis_report_style.xml
index ff7564b1..a6f74938 100644
--- a/mis_builder_cash_flow/data/mis_report_style.xml
+++ b/mis_builder_cash_flow/data/mis_report_style.xml
@@ -1,71 +1,61 @@
-
+
-
-
-
- Cash Flow
-
-
-
-
-
- Cash flow style account detail
-
- italic
-
- 2
-
- x-small
-
-
-
- Cash flow line
-
- #FFFFFF
-
- #D4AFC4
-
- 1
-
-
-
- Cash flow style sub-total
-
- #FFFFFF
-
- #967C8B
-
- bold
-
-
-
- Cash flow style total
-
- #FFFFFF
-
- #7A6571
-
- bold
-
-
-
- Cash Flow - hidden
-
-
-
-
-
- Cash Flow - Good
-
- #005700
-
-
-
- Cash Flow - Bad
-
- #7A0000
-
-
+
+ Cash Flow
+
+
+
+
+ Cash flow style account detail
+
+ italic
+
+ 2
+
+ x-small
+
+
+ Cash flow line
+
+ #FFFFFF
+
+ #D4AFC4
+
+ 1
+
+
+ Cash flow style sub-total
+
+ #FFFFFF
+
+ #967C8B
+
+ bold
+
+
+ Cash flow style total
+
+ #FFFFFF
+
+ #7A6571
+
+ bold
+
+
+ Cash Flow - hidden
+
+
+
+
+ Cash Flow - Good
+
+ #005700
+
+
+ Cash Flow - Bad
+
+ #7A0000
+
diff --git a/mis_builder_cash_flow/models/account_account.py b/mis_builder_cash_flow/models/account_account.py
index 828f1585..2d3c4d66 100644
--- a/mis_builder_cash_flow/models/account_account.py
+++ b/mis_builder_cash_flow/models/account_account.py
@@ -5,8 +5,6 @@ from odoo import fields, models
class AccountAccount(models.Model):
- _inherit = 'account.account'
+ _inherit = "account.account"
- hide_in_cash_flow = fields.Boolean(
- string='Hide in Cash Flow?',
- )
+ hide_in_cash_flow = fields.Boolean(string="Hide in Cash Flow?",)
diff --git a/mis_builder_cash_flow/models/mis_cash_flow_forecast_line.py b/mis_builder_cash_flow/models/mis_cash_flow_forecast_line.py
index 6173d6e9..d9c1bc6c 100644
--- a/mis_builder_cash_flow/models/mis_cash_flow_forecast_line.py
+++ b/mis_builder_cash_flow/models/mis_cash_flow_forecast_line.py
@@ -1,48 +1,36 @@
# Copyright 2019 ADHOC SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from odoo import fields, models, api, _
+from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class MisCashFlowForecastLine(models.Model):
- _name = 'mis.cash_flow.forecast_line'
- _description = 'MIS Cash Flow Forecast Line'
+ _name = "mis.cash_flow.forecast_line"
+ _description = "MIS Cash Flow Forecast Line"
- date = fields.Date(
- required=True,
- index=True,
- )
+ date = fields.Date(required=True, index=True,)
account_id = fields.Many2one(
- comodel_name='account.account',
- string='Account',
- required=True,
- help='The account of the forecast line is only for informative '
- 'purpose',
- )
- partner_id = fields.Many2one(
- comodel_name='res.partner',
- string='Partner',
- )
- name = fields.Char(
- required=True,
- default='/',
- )
- balance = fields.Float(
+ comodel_name="account.account",
+ string="Account",
required=True,
+ help="The account of the forecast line is only for informative " "purpose",
)
+ partner_id = fields.Many2one(comodel_name="res.partner", string="Partner",)
+ name = fields.Char(required=True, default="/",)
+ balance = fields.Float(required=True,)
company_id = fields.Many2one(
- 'res.company',
- string='Company',
+ "res.company",
+ string="Company",
required=True,
default=lambda self: self.env.user.company_id.id,
index=True,
)
@api.multi
- @api.constrains('company_id', 'account_id')
+ @api.constrains("company_id", "account_id")
def _check_company_id_account_id(self):
if self.filtered(lambda x: x.company_id != x.account_id.company_id):
- raise ValidationError(_(
- 'The Company and the Company of the Account must be the '
- 'same.'))
+ raise ValidationError(
+ _("The Company and the Company of the Account must be the " "same.")
+ )
diff --git a/mis_builder_cash_flow/readme/ROADMAP.rst b/mis_builder_cash_flow/readme/ROADMAP.rst
index b11c6391..085352cd 100644
--- a/mis_builder_cash_flow/readme/ROADMAP.rst
+++ b/mis_builder_cash_flow/readme/ROADMAP.rst
@@ -1,3 +1,3 @@
-The mis_builder `roadmap `_
-and `known issues `_ can
+The mis_builder `roadmap `_
+and `known issues `_ can
be found on GitHub.
diff --git a/mis_builder_cash_flow/report/mis_cash_flow.py b/mis_builder_cash_flow/report/mis_cash_flow.py
index 7e82eea3..e9909d0b 100644
--- a/mis_builder_cash_flow/report/mis_cash_flow.py
+++ b/mis_builder_cash_flow/report/mis_cash_flow.py
@@ -1,79 +1,61 @@
# Copyright 2019 ADHOC SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from odoo import api, fields, models, tools
from psycopg2.extensions import AsIs
+from odoo import api, fields, models, tools
+
class MisCashFlow(models.Model):
- _name = 'mis.cash_flow'
- _description = 'MIS Cash Flow'
+ _name = "mis.cash_flow"
+ _description = "MIS Cash Flow"
_auto = False
line_type = fields.Selection(
- [('forecast_line', 'Forecast Line'), ('move_line', 'Journal Item')],
+ [("forecast_line", "Forecast Line"), ("move_line", "Journal Item")],
index=True,
readonly=True,
)
- name = fields.Char(
- readonly=True,
- )
+ name = fields.Char(readonly=True,)
account_id = fields.Many2one(
- comodel_name='account.account',
- string='Account',
+ comodel_name="account.account",
+ string="Account",
auto_join=True,
index=True,
readonly=True,
)
partner_id = fields.Many2one(
- comodel_name='res.partner',
- string='Partner',
- readonly=True,
+ comodel_name="res.partner", string="Partner", readonly=True,
)
move_line_id = fields.Many2one(
- comodel_name='account.move.line',
- string='Journal Item',
+ comodel_name="account.move.line",
+ string="Journal Item",
auto_join=True,
readonly=True,
)
company_id = fields.Many2one(
- comodel_name='res.company',
- string='Company',
+ comodel_name="res.company",
+ string="Company",
auto_join=True,
readonly=True,
index=True,
)
- credit = fields.Float(
- readonly=True,
- )
- debit = fields.Float(
- readonly=True,
- )
- date = fields.Date(
- readonly=True,
- index=True,
- )
- reconciled = fields.Boolean(
- readonly=True,
- )
+ credit = fields.Float(readonly=True,)
+ debit = fields.Float(readonly=True,)
+ date = fields.Date(readonly=True, index=True,)
+ reconciled = fields.Boolean(readonly=True,)
full_reconcile_id = fields.Many2one(
- 'account.full.reconcile',
- string="Matching Number",
- readonly=True,
- index=True,
+ "account.full.reconcile", string="Matching Number", readonly=True, index=True,
)
user_type_id = fields.Many2one(
- 'account.account.type',
- auto_join=True,
- readonly=True,
- index=True,
+ "account.account.type", auto_join=True, readonly=True, index=True,
)
@api.model_cr
def init(self):
- account_type_receivable = self.env.ref(
- 'account.data_account_type_receivable')
- query = """
+ account_type_receivable = self.env.ref("account.data_account_type_receivable")
+ query = (
+ """
SELECT
-- we use negative id to avoid duplicates and we don't use
-- ROW_NUMBER() because the performance was very poor
@@ -123,18 +105,22 @@ class MisCashFlow(models.Model):
fl.name as name,
fl.date as date
FROM mis_cash_flow_forecast_line as fl
- """ % account_type_receivable.id
+ """
+ % account_type_receivable.id
+ )
tools.drop_view_if_exists(self.env.cr, self._table)
self._cr.execute(
- 'CREATE OR REPLACE VIEW %s AS %s',
- (AsIs(self._table), AsIs(query))
+ "CREATE OR REPLACE VIEW %s AS %s", (AsIs(self._table), AsIs(query))
)
@api.multi
def action_open_related_line(self):
self.ensure_one()
- if self.line_type == 'move_line':
+ if self.line_type == "move_line":
return self.move_line_id.get_formview_action()
else:
- return self.env['mis.cash_flow.forecast_line'].browse(
- self.id).get_formview_action()
+ return (
+ self.env["mis.cash_flow.forecast_line"]
+ .browse(self.id)
+ .get_formview_action()
+ )
diff --git a/mis_builder_cash_flow/report/mis_cash_flow_views.xml b/mis_builder_cash_flow/report/mis_cash_flow_views.xml
index 28dbd96c..378d1969 100644
--- a/mis_builder_cash_flow/report/mis_cash_flow_views.xml
+++ b/mis_builder_cash_flow/report/mis_cash_flow_views.xml
@@ -1,27 +1,29 @@
-
+
-
-
mis.cash_flow.tree
mis.cash_flow
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
mis.cash_flow.form
mis.cash_flow
@@ -29,67 +31,75 @@
-
mis.cash_flow.search
mis.cash_flow
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
+
+
-
+
+ domain="[('line_type','=', 'forecast_line')]"
+ />
-
-
+
-
+
-
+
+ groups="base.group_multi_company"
+ />
-
diff --git a/mis_builder_cash_flow/security/mis_cash_flow_security.xml b/mis_builder_cash_flow/security/mis_cash_flow_security.xml
index e35d353e..0d82a6c5 100644
--- a/mis_builder_cash_flow/security/mis_cash_flow_security.xml
+++ b/mis_builder_cash_flow/security/mis_cash_flow_security.xml
@@ -1,27 +1,23 @@
-
+
-
-
mis.cash_flow
-
-
-
-
-
-
+
+
+
+
+
+
-
mis.cash_flow.forecast_line
-
-
-
-
-
-
+
+
+
+
+
+
-
diff --git a/mis_builder_cash_flow/tests/test_cash_flow.py b/mis_builder_cash_flow/tests/test_cash_flow.py
index a6c2f071..84656001 100644
--- a/mis_builder_cash_flow/tests/test_cash_flow.py
+++ b/mis_builder_cash_flow/tests/test_cash_flow.py
@@ -5,113 +5,140 @@ from datetime import timedelta
from odoo.exceptions import ValidationError
from odoo.fields import Date
+from odoo.tests.common import TransactionCase, at_install, post_install
from odoo.tools import mute_logger
-from odoo.tests.common import TransactionCase, post_install, at_install
@at_install(False)
@post_install(True)
class TestCashFlow(TransactionCase):
-
def setUp(self):
super().setUp()
- self.company = self.env['res.company'].create({
- 'name': 'TEST'
- })
- self.report = self.browse_ref(
- 'mis_builder_cash_flow.mis_instance_cash_flow')
+ self.company = self.env["res.company"].create({"name": "TEST"})
+ self.report = self.browse_ref("mis_builder_cash_flow.mis_instance_cash_flow")
self.report.company_id = self.company
- self.bank_account = self.env['account.account'].create({
- "company_id": self.company.id,
- "code": "TEST1",
- "name": "Bank account 01",
- "user_type_id": self.browse_ref(
- "account.data_account_type_liquidity"
- ).id,
- })
- self.bank_account_hide = self.env['account.account'].create({
- "company_id": self.company.id,
- "code": "TEST2",
- "name": "Bank account 02",
- "user_type_id": self.browse_ref(
- "account.data_account_type_liquidity"
- ).id,
- "hide_in_cash_flow": True,
- })
- self.account = self.env['account.account'].create({
- "company_id": self.company.id,
- "code": "TEST3",
- "name": "Account",
- "user_type_id": self.browse_ref(
- "account.data_account_type_receivable"
- ).id,
- "reconcile": True,
- })
- self.journal = self.env["account.journal"].create({
- "name": "Journal",
- "code": "JOURNAL",
- "company_id": self.company.id,
- "type": "general",
- })
+ self.bank_account = self.env["account.account"].create(
+ {
+ "company_id": self.company.id,
+ "code": "TEST1",
+ "name": "Bank account 01",
+ "user_type_id": self.browse_ref(
+ "account.data_account_type_liquidity"
+ ).id,
+ }
+ )
+ self.bank_account_hide = self.env["account.account"].create(
+ {
+ "company_id": self.company.id,
+ "code": "TEST2",
+ "name": "Bank account 02",
+ "user_type_id": self.browse_ref(
+ "account.data_account_type_liquidity"
+ ).id,
+ "hide_in_cash_flow": True,
+ }
+ )
+ self.account = self.env["account.account"].create(
+ {
+ "company_id": self.company.id,
+ "code": "TEST3",
+ "name": "Account",
+ "user_type_id": self.browse_ref(
+ "account.data_account_type_receivable"
+ ).id,
+ "reconcile": True,
+ }
+ )
+ self.journal = self.env["account.journal"].create(
+ {
+ "name": "Journal",
+ "code": "JOURNAL",
+ "company_id": self.company.id,
+ "type": "general",
+ }
+ )
def test_company_constrain(self):
with self.assertRaises(ValidationError):
- self.env['mis.cash_flow.forecast_line'].create({
- 'account_id': self.account.id,
- 'date': Date.today(),
- 'balance': 1000,
- })
+ self.env["mis.cash_flow.forecast_line"].create(
+ {"account_id": self.account.id, "date": Date.today(), "balance": 1000,}
+ )
def test_report_instance(self):
self.check_matrix()
- move = self.env['account.move'].create({
- 'name': 'Move',
- 'journal_id': self.journal.id,
- 'company_id': self.company.id,
- 'line_ids': [(0, 0, {
- 'account_id': self.bank_account.id,
- 'debit': 1500,
- 'credit': 0,
- 'company_id': self.company.id,
- }), (0, 0, {
- 'account_id': self.bank_account_hide.id,
- 'debit': 500,
- 'credit': 0,
- 'company_id': self.company.id,
- }), (0, 0, {
- 'account_id': self.account.id,
- 'debit': 0,
- 'credit': 2000,
- 'company_id': self.company.id,
- })]
- })
+ move = self.env["account.move"].create(
+ {
+ "name": "Move",
+ "journal_id": self.journal.id,
+ "company_id": self.company.id,
+ "line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "account_id": self.bank_account.id,
+ "debit": 1500,
+ "credit": 0,
+ "company_id": self.company.id,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "account_id": self.bank_account_hide.id,
+ "debit": 500,
+ "credit": 0,
+ "company_id": self.company.id,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "account_id": self.account.id,
+ "debit": 0,
+ "credit": 2000,
+ "company_id": self.company.id,
+ },
+ ),
+ ],
+ }
+ )
move.post()
- self.check_matrix(args=[
- ('liquidity', 'Current', 1500),
- ('balance', 'Current', 1500),
- ('in_receivable', 'Current', -2000),
- ], ignore_rows=['balance', 'period_balance', 'in_total'],
+ self.check_matrix(
+ args=[
+ ("liquidity", "Current", 1500),
+ ("balance", "Current", 1500),
+ ("in_receivable", "Current", -2000),
+ ],
+ ignore_rows=["balance", "period_balance", "in_total"],
)
date = Date.from_string(Date.today()) + timedelta(weeks=8)
- self.env['mis.cash_flow.forecast_line'].create({
- 'account_id': self.account.id,
- 'date': Date.to_string(date),
- 'balance': 1000,
- 'company_id': self.company.id,
- })
- self.check_matrix([
- ('liquidity', 'Current', 1500),
- ('balance', 'Current', 1500),
- ('in_receivable', 'Current', -2000),
- ('in_forecast', '+8w', 1000),
- ], ignore_rows=['balance', 'period_balance', 'in_total'])
+ self.env["mis.cash_flow.forecast_line"].create(
+ {
+ "account_id": self.account.id,
+ "date": Date.to_string(date),
+ "balance": 1000,
+ "company_id": self.company.id,
+ }
+ )
+ self.check_matrix(
+ [
+ ("liquidity", "Current", 1500),
+ ("balance", "Current", 1500),
+ ("in_receivable", "Current", -2000),
+ ("in_forecast", "+8w", 1000),
+ ],
+ ignore_rows=["balance", "period_balance", "in_total"],
+ )
def check_matrix(self, args=False, ignore_rows=False):
if not args:
args = []
if not ignore_rows:
ignore_rows = []
- with mute_logger('odoo.addons.mis_builder.models.kpimatrix'):
+ with mute_logger("odoo.addons.mis_builder.models.kpimatrix"):
matrix = self.report._compute_matrix()
for row in matrix.iter_rows():
if row.kpi.name in ignore_rows:
diff --git a/mis_builder_cash_flow/views/account_account_views.xml b/mis_builder_cash_flow/views/account_account_views.xml
index cb499476..69ca364f 100644
--- a/mis_builder_cash_flow/views/account_account_views.xml
+++ b/mis_builder_cash_flow/views/account_account_views.xml
@@ -1,14 +1,15 @@
-
account.account
account.account.form
-
+
-
+
-
diff --git a/mis_builder_cash_flow/views/mis_cash_flow_forecast_line_views.xml b/mis_builder_cash_flow/views/mis_cash_flow_forecast_line_views.xml
index ea921087..3e9d6589 100644
--- a/mis_builder_cash_flow/views/mis_cash_flow_forecast_line_views.xml
+++ b/mis_builder_cash_flow/views/mis_cash_flow_forecast_line_views.xml
@@ -1,9 +1,7 @@
-
+
-
-
mis.cash_flow.forecast_line.tree
mis.cash_flow.forecast_line
@@ -11,77 +9,84 @@
-
mis.cash_flow.forecast_line.search
mis.cash_flow.forecast_line
-
-
-
+
+
+
-
-
+
+
-
-
+
-
+
-
+
+ context="{'group_by':'company_id'}"
+ groups="base.group_multi_company"
+ />
-
mis.cash_flow.forecast_line.tree
mis.cash_flow.forecast_line
-
-
-
+
+
+
-
-
+
+
-
Cash Flow Forecast Line
-
+
mis.cash_flow.forecast_line
tree,form
-
-
-
+ sequence="23"
+ />