Skip to content

Commit

Permalink
mis_builder_budget: add active fields Add active field on mis.budget.…
Browse files Browse the repository at this point in the history
…by.account and mis.budget model and related views
  • Loading branch information
acsonefho authored and sbidoul committed Dec 11, 2024
1 parent 21bccb7 commit f75a347
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions mis_builder_budget/models/mis_budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ class MisBudget(models.Model):
item_ids = fields.One2many(
comodel_name="mis.budget.item", inverse_name="budget_id", copy=True
)
active = fields.Boolean(default=True, copy=False)
1 change: 1 addition & 0 deletions mis_builder_budget/models/mis_budget_by_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ class MisBudgetByAccount(models.Model):
allow_items_overlap = fields.Boolean(
help="If checked, overlap between budget items is allowed"
)
active = fields.Boolean(default=True, copy=False)
13 changes: 13 additions & 0 deletions mis_builder_budget/views/mis_budget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<field name="state" widget="statusbar" />
</header>
<sheet>
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<div class="oe_button_box" name="button_box">
<button
name="%(mis_budget_item_act_window)d"
Expand All @@ -41,6 +47,7 @@
</div>
<group>
<field name="name" />
<field name="active" invisible="True" />
<field name="description" />
<field name="report_id" />
<field name="company_id" groups="base.group_multi_company" />
Expand All @@ -65,6 +72,12 @@
<search>
<field name="name" />
<field name="state" />
<separator />
<filter
string="Archived"
name="inactive"
domain="[('active', '=', False)]"
/>
</search>
</field>
</record>
Expand Down
13 changes: 13 additions & 0 deletions mis_builder_budget/views/mis_budget_by_account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<field name="state" widget="statusbar" />
</header>
<sheet>
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<div class="oe_button_box" name="button_box">
<button
name="%(mis_budget_by_account_item_act_window)d"
Expand All @@ -41,6 +47,7 @@
</div>
<group>
<field name="name" />
<field name="active" invisible="True" />
<field name="description" />
<field
name="company_id"
Expand Down Expand Up @@ -69,6 +76,12 @@
<search>
<field name="name" />
<field name="state" />
<separator />
<filter
string="Archived"
name="inactive"
domain="[('active', '=', False)]"
/>
</search>
</field>
</record>
Expand Down

0 comments on commit f75a347

Please sign in to comment.