Skip to content

Commit

Permalink
[MIG] account_budget_oca: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
polqubiq committed Sep 18, 2023
1 parent 2f643ba commit f5953aa
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 41 deletions.
2 changes: 1 addition & 1 deletion account_budget_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Budgets Management",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Accounting",
"license": "LGPL-3",
"author": "Odoo S.A., Odoo Community Association (OCA)",
Expand Down
64 changes: 31 additions & 33 deletions account_budget_oca/security/account_budget_security.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<odoo>
<data noupdate="1">
<record id="budget_post_comp_rule" model="ir.rule">
<field name="name">Budget post multi-company</field>
<field name="model_id" ref="model_account_budget_post" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="budget_comp_rule" model="ir.rule">
<field name="name">Budget multi-company</field>
<field name="model_id" ref="model_crossovered_budget" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="budget_lines_comp_rule" model="ir.rule">
<field name="name">Budget lines multi-company</field>
<field name="model_id" ref="model_crossovered_budget_lines" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="base.user_root" model="res.users">
<field
name="groups_id"
eval="[(4,ref('analytic.group_analytic_accounting'))]"
/>
</record>
</data>
<odoo noupdate="1">
<record id="budget_post_comp_rule" model="ir.rule">
<field name="name">Budget post multi-company</field>
<field name="model_id" ref="model_account_budget_post" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="budget_comp_rule" model="ir.rule">
<field name="name">Budget multi-company</field>
<field name="model_id" ref="model_crossovered_budget" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="budget_lines_comp_rule" model="ir.rule">
<field name="name">Budget lines multi-company</field>
<field name="model_id" ref="model_crossovered_budget_lines" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>
<record id="base.user_root" model="res.users">
<field
name="groups_id"
eval="[(4,ref('analytic.group_analytic_accounting'))]"
/>
</record>
</odoo>
8 changes: 4 additions & 4 deletions account_budget_oca/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):
# Checking if the budgetary positions have accounts or not
account_ids = self.account_model.search(
[
("user_type_id", "=", self.ref("account.data_account_type_revenue")),
("account_type", "=", "income"),
("tag_ids.name", "in", ["Operating Activities"]),
]
).ids
Expand All @@ -32,7 +32,7 @@ def setUp(self):
{
"name": "Product Sales - (test)",
"code": "X2020",
"user_type_id": self.ref("account.data_account_type_revenue"),
"account_type": "income",
"tag_ids": [(6, 0, [self.ref("account.account_tag_operating")])],
}
).ids
Expand Down Expand Up @@ -159,7 +159,7 @@ def setUp(self):

account_ids = self.account_model.search(
[
("user_type_id.name", "=", "Expenses"),
("account_type", "=", "expense"),
("tag_ids.name", "in", ["Operating Activities"]),
]
).ids
Expand All @@ -169,7 +169,7 @@ def setUp(self):
{
"name": "Expense - (test)",
"code": "X2120",
"user_type_id": self.ref("account.data_account_type_expenses"),
"account_type": "expense",
"tag_ids": [(6, 0, [self.ref("account.account_tag_operating")])],
}
).ids
Expand Down
3 changes: 1 addition & 2 deletions account_budget_oca/tests/test_theoreticalamount.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ def setUp(self):
}
)
crossovered_budget_line_obj = self.env["crossovered.budget.lines"]
user_type_id = self.ref("account.data_account_type_revenue")
tag_id = self.ref("account.account_tag_operating")
account_rev = self.env["account.account"].create(
{
"code": "Y2020",
"name": "Budget - Test Revenue Account",
"user_type_id": user_type_id,
"account_type": "income",
"tag_ids": [(4, tag_id, 0)],
}
)
Expand Down
7 changes: 6 additions & 1 deletion account_budget_oca/views/account_budget_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
groups="base.group_multi_company"
options="{'no_create': True}"
/>
<field
name="company_id"
invisible="1"
groups="!base.group_multi_company"
options="{'no_create': True}"
/>
</group>
<notebook>
<page string="Accounts">
Expand Down Expand Up @@ -253,7 +259,6 @@
<tree
decoration-info="state == 'draft'"
decoration-muted="state in ('done','cancel')"
string="Budget"
>
<field name="name" colspan="1" />
<field name="date_from" />
Expand Down

0 comments on commit f5953aa

Please sign in to comment.