Browse Source

[NEW] add active option

12.0-mis_builder_analytic_cash_flow
Nicolas JEUDY 3 years ago
parent
commit
670cb051c1
  1. 1
      mis_builder_analytic_cash_flow/models/mis_cash_flow_forecast_line.py
  2. 6
      mis_builder_analytic_cash_flow/report/mis_cash_flow.py
  3. 8
      mis_builder_analytic_cash_flow/views/mis_cash_flow_forecast_line_views.xml

1
mis_builder_analytic_cash_flow/models/mis_cash_flow_forecast_line.py

@ -6,6 +6,7 @@ class MisCashFlowForecastLine(models.Model):
_inherit = 'mis.cash_flow.forecast_line'
active = fields.Boolean(default=True)
analytic_account_id = fields.Many2one(
comodel_name='account.analytic.account',
string='Analytic Account',

6
mis_builder_analytic_cash_flow/report/mis_cash_flow.py

@ -6,7 +6,7 @@ class MisCashFlow(models.Model):
_inherit = 'mis.cash_flow'
active = fields.Boolean(default=True)
analytic_account_id = fields.Many2one(
comodel_name='account.analytic.account',
string='Analytic Account',
@ -37,7 +37,8 @@ class MisCashFlow(models.Model):
aml.company_id as company_id,
aml.user_type_id as user_type_id,
aml.name as name,
aml.date_maturity as date
aml.date_maturity as date,
1 as active
FROM account_move_line as aml
UNION ALL
SELECT
@ -45,6 +46,7 @@ class MisCashFlow(models.Model):
CAST('forecast_line' AS varchar) as line_type,
Null as move_line_id,
fl.account_id as account_id,
fl.active as active,
fl.analytic_account_id as analytic_account_id,
CASE
WHEN fl.balance > 0

8
mis_builder_analytic_cash_flow/views/mis_cash_flow_forecast_line_views.xml

@ -8,7 +8,8 @@
<field name="inherit_id" ref="mis_builder_cash_flow.mis_cash_flow_forecast_line_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='account_id']" position="after">
<field name="analytic_account_id" domain="[('company_id', '=', company_id)]"/>
<field name="analytic_account_id" domain="[('company_id', '=', company_id)]"/>
<field name="active"/>
</xpath>
</field>
</record>
@ -30,7 +31,10 @@
<field name="inherit_id" ref="mis_builder_cash_flow.mis_cash_flow_forecast_line_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='account_id']" position="after">
<field name="analytic_account_id"/>
<field name="analytic_account_id"/>
</xpath>
<xpath expr="//field[@name='balance']" position="after">
<field name="active"/>
</xpath>
</field>
</record>

Loading…
Cancel
Save