mreficent
5 years ago
13 changed files with 588 additions and 600 deletions
-
37mis_builder_cash_flow/__manifest__.py
-
44mis_builder_cash_flow/data/mis_report.xml
-
14mis_builder_cash_flow/data/mis_report_instance.xml
-
10mis_builder_cash_flow/data/mis_report_style.xml
-
6mis_builder_cash_flow/models/account_account.py
-
44mis_builder_cash_flow/models/mis_cash_flow_forecast_line.py
-
78mis_builder_cash_flow/report/mis_cash_flow.py
-
66mis_builder_cash_flow/report/mis_cash_flow_views.xml
-
4mis_builder_cash_flow/security/mis_cash_flow_security.xml
-
145mis_builder_cash_flow/tests/test_cash_flow.py
-
7mis_builder_cash_flow/views/account_account_views.xml
-
59mis_builder_cash_flow/views/mis_cash_flow_forecast_line_views.xml
@ -1,48 +1,36 @@ |
|||||
# Copyright 2019 ADHOC SA |
# Copyright 2019 ADHOC SA |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
# 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 |
from odoo.exceptions import ValidationError |
||||
|
|
||||
|
|
||||
class MisCashFlowForecastLine(models.Model): |
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( |
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, |
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( |
company_id = fields.Many2one( |
||||
'res.company', |
|
||||
string='Company', |
|
||||
|
"res.company", |
||||
|
string="Company", |
||||
required=True, |
required=True, |
||||
default=lambda self: self.env.user.company_id.id, |
default=lambda self: self.env.user.company_id.id, |
||||
index=True, |
index=True, |
||||
) |
) |
||||
|
|
||||
@api.multi |
@api.multi |
||||
@api.constrains('company_id', 'account_id') |
|
||||
|
@api.constrains("company_id", "account_id") |
||||
def _check_company_id_account_id(self): |
def _check_company_id_account_id(self): |
||||
if self.filtered(lambda x: x.company_id != x.account_id.company_id): |
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.") |
||||
|
) |
@ -1,14 +1,15 @@ |
|||||
<odoo> |
<odoo> |
||||
|
|
||||
<record id="view_account_form" model="ir.ui.view"> |
<record id="view_account_form" model="ir.ui.view"> |
||||
<field name="model">account.account</field> |
<field name="model">account.account</field> |
||||
<field name="name">account.account.form</field> |
<field name="name">account.account.form</field> |
||||
<field name="inherit_id" ref="account.view_account_form" /> |
<field name="inherit_id" ref="account.view_account_form" /> |
||||
<field name="arch" type="xml"> |
<field name="arch" type="xml"> |
||||
<field name="deprecated" position="after"> |
<field name="deprecated" position="after"> |
||||
<field name="hide_in_cash_flow" attrs="{'invisible': [('internal_type', 'not in', ['receivable', 'payable', 'liquidity'])]}"/> |
|
||||
|
<field |
||||
|
name="hide_in_cash_flow" |
||||
|
attrs="{'invisible': [('internal_type', 'not in', ['receivable', 'payable', 'liquidity'])]}" |
||||
|
/> |
||||
</field> |
</field> |
||||
</field> |
</field> |
||||
</record> |
</record> |
||||
|
|
||||
</odoo> |
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue