Skip to content

Commit

Permalink
[MIG] mis_builder_budget: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioburic authored and dreispt committed Aug 27, 2024
1 parent 2818639 commit 98deed3
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 24 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^mis_builder_budget/|
^mis_builder_demo/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
Expand Down
2 changes: 0 additions & 2 deletions mis_builder_budget/models/mis_budget_by_account_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ class MisBudgetByAccountItem(models.Model):
company_id = fields.Many2one(
"res.company",
related="budget_id.company_id",
readonly=True,
store=True,
)
company_currency_id = fields.Many2one(
"res.currency",
related="budget_id.company_id.currency_id",
string="Company Currency",
readonly=True,
help="Utility field to express amount currency",
store=True,
)
Expand Down
2 changes: 1 addition & 1 deletion mis_builder_budget/models/mis_budget_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MisBudgetItem(models.Model):
_order = "budget_id, date_from, seq1, seq2"

budget_id = fields.Many2one(comodel_name="mis.budget")
report_id = fields.Many2one(related="budget_id.report_id", readonly=True)
report_id = fields.Many2one(related="budget_id.report_id")
kpi_expression_id = fields.Many2one(
domain=(
"[('kpi_id.report_id', '=', report_id),"
Expand Down
6 changes: 2 additions & 4 deletions mis_builder_budget/models/mis_budget_item_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ class MisBudgetItemAbstract(models.AbstractModel):
index=True,
)
budget_date_from = fields.Date(
related="budget_id.date_from", readonly=True, string="Budget Date From"
)
budget_date_to = fields.Date(
related="budget_id.date_to", readonly=True, string="Budget Date To"
related="budget_id.date_from", string="Budget Date From"
)
budget_date_to = fields.Date(related="budget_id.date_to", string="Budget Date To")
date_range_id = fields.Many2one(
comodel_name="date.range",
domain="[('date_start', '>=', budget_date_from),"
Expand Down
6 changes: 3 additions & 3 deletions mis_builder_budget/views/mis_budget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
name="action_draft"
string="Set draft"
type="object"
attrs="{'invisible': [('state', '=', 'draft')]}"
invisible="state == 'draft'"
/>
<button
name="action_confirm"
string="Confirm"
type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"
invisible="state != 'draft'"
class="oe_highlight"
/>
<button
name="action_cancel"
string="Cancel"
type="object"
attrs="{'invisible': [('state', '=', 'cancelled')]}"
invisible="state == 'cancelled'"
/>
<field name="state" widget="statusbar" />
</header>
Expand Down
12 changes: 8 additions & 4 deletions mis_builder_budget/views/mis_budget_by_account.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
name="action_draft"
string="Set draft"
type="object"
attrs="{'invisible': [('state', '=', 'draft')]}"
invisible="state == 'draft'"
/>
<button
name="action_confirm"
string="Confirm"
type="object"
attrs="{'invisible': [('state', '!=', 'draft')]}"
invisible="state != 'draft'"
class="oe_highlight"
/>
<button
name="action_cancel"
string="Cancel"
type="object"
attrs="{'invisible': [('state', '=', 'cancelled')]}"
invisible="state == 'cancelled'"
/>
<field name="state" widget="statusbar" />
</header>
Expand All @@ -42,7 +42,11 @@
<group>
<field name="name" />
<field name="description" />
<field name="company_id" groups="base.group_multi_company" />
<field
name="company_id"
readonly="1"
groups="base.group_multi_company"
/>
</group>
<group>
<field name="date_range_id" />
Expand Down
6 changes: 3 additions & 3 deletions mis_builder_budget/views/mis_budget_by_account_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<field name="model">mis.budget.by.account.item</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="budget_id" invisible="1" />
<field name="budget_date_from" invisible="1" />
<field name="budget_date_to" invisible="1" />
<field name="budget_id" column_invisible="1" />
<field name="budget_date_from" column_invisible="1" />
<field name="budget_date_to" column_invisible="1" />
<field name="name" />
<field name="account_id" />
<field name="date_range_id" />
Expand Down
8 changes: 4 additions & 4 deletions mis_builder_budget/views/mis_budget_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<field name="model">mis.budget.item</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="budget_id" invisible="1" />
<field name="report_id" invisible="1" />
<field name="budget_date_from" invisible="1" />
<field name="budget_date_to" invisible="1" />
<field name="budget_id" column_invisible="1" />
<field name="report_id" column_invisible="1" />
<field name="budget_date_from" column_invisible="1" />
<field name="budget_date_to" column_invisible="1" />
<field name="kpi_expression_id" />
<field name="date_range_id" />
<field name="date_from" />
Expand Down
6 changes: 4 additions & 2 deletions mis_builder_budget/views/mis_report_instance_period.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
<group name="source_data" position="inside">
<field
name="source_mis_budget_id"
attrs="{'invisible': [('source', '!=', 'mis_budget')], 'required': [('source', '=', 'mis_budget')]}"
invisible="source != 'mis_budget'"
required="source == 'mis_budget'"
domain="[('report_id', '=', report_id)]"
/>
<field
name="source_mis_budget_by_account_id"
attrs="{'invisible': [('source', '!=', 'mis_budget_by_account')], 'required': [('source', '=', 'mis_budget_by_account')]}"
invisible="source != 'mis_budget_by_account'"
required="source == 'mis_budget_by_account'"
/>
</group>
</field>
Expand Down

0 comments on commit 98deed3

Please sign in to comment.