Skip to content

Commit

Permalink
[MIG] account_analytic_parent: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad Azeem authored and OCA-git-bot committed Dec 18, 2023
1 parent 6f3aee4 commit 1911139
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 7 deletions.
2 changes: 1 addition & 1 deletion account_analytic_parent/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"name": "Account Analytic Parent",
"summary": """
This module reintroduces the hierarchy to the analytic accounts.""",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Accounting & Finance",
"license": "AGPL-3",
"author": "Matmoz d.o.o., "
Expand Down
35 changes: 35 additions & 0 deletions account_analytic_parent/demo/analytic_account_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,72 @@
-->
<record id="analytic_project_1" model="account.analytic.account">
<field name="name">Project 1</field>
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic_project_2" model="account.analytic.account">
<field name="name">Project 2</field>
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic_journal_trainings" model="account.analytic.account">
<field name="name">Training</field>
<field name="parent_id" ref="analytic.analytic_internal" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_in_house" model="account.analytic.account">
<field name="name">In House</field>
<field name="parent_id" ref="analytic_journal_trainings" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_online" model="account.analytic.account">
<field name="name">Online</field>
<field name="parent_id" ref="analytic_journal_trainings" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_support" model="account.analytic.account">
<field name="name">Support</field>
<field name="parent_id" ref="analytic.analytic_our_super_product" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_partners" model="account.analytic.account">
<field name="name">Partners</field>
<field name="parent_id" ref="analytic_support" />
<field name="plan_id" ref="analytic.analytic_plan_internal" />
</record>
<record id="analytic_customers" model="account.analytic.account">
<field name="name">Customers</field>
<field name="parent_id" ref="analytic_support" />
<field name="plan_id" ref="analytic.analytic_plan_internal" />
</record>
<record id="analytic_support_internal" model="account.analytic.account">
<field name="name">Internal</field>
<field name="parent_id" ref="analytic_support" />
<field name="plan_id" ref="analytic.analytic_plan_internal" />
</record>
<record id="analytic_integration" model="account.analytic.account">
<field name="name">Integration</field>
<field name="parent_id" ref="analytic.analytic_our_super_product" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_consultancy" model="account.analytic.account">
<field name="name">Consultancy</field>
<field name="parent_id" ref="analytic.analytic_our_super_product" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_super_product_trainings" model="account.analytic.account">
<field name="name">Training</field>
<field name="parent_id" ref="analytic.analytic_our_super_product" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_seagate_p1" model="account.analytic.account">
<field name="name">Seagate P1</field>
<field name="parent_id" ref="analytic_integration" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic_seagate_p2" model="account.analytic.account">
<field name="name">Seagate P2</field>
<field name="parent_id" ref="analytic_integration" />
<field name="partner_id" ref="base.res_partner_4" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record
id="analytic.analytic_millennium_industries"
Expand All @@ -65,36 +79,43 @@
<field name="name">Millennium Industries</field>
<field name="parent_id" ref="analytic_integration" />
<field name="partner_id" ref="base.res_partner_2" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_integration_c2c" model="account.analytic.account">
<field name="name">CampToCamp</field>
<field name="parent_id" ref="analytic_integration" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_agrolait" model="account.analytic.account">
<field name="name">Agrolait</field>
<field name="parent_id" ref="analytic_customers" />
<field name="partner_id" ref="base.res_partner_2" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_asustek" model="account.analytic.account">
<field name="name">Asustek</field>
<field name="parent_id" ref="analytic_customers" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_deltapc" model="account.analytic.account">
<field name="name">Delta PC</field>
<field name="parent_id" ref="analytic_customers" />
<field name="partner_id" ref="base.res_partner_4" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_spark" model="account.analytic.account">
<field name="name">Spark Systems</field>
<field name="parent_id" ref="analytic_partners" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_nebula" model="account.analytic.account">
<field name="name">Nebula</field>
<field name="parent_id" ref="analytic_partners" />
<field name="partner_id" ref="base.res_partner_2" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record
id="analytic.analytic_luminous_technologies"
Expand All @@ -103,11 +124,13 @@
<field name="name">Luminous Technologies</field>
<field name="parent_id" ref="analytic_partners" />
<field name="partner_id" ref="base.res_partner_1" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record id="analytic.analytic_think_big_systems" model="account.analytic.account">
<field name="name">Think Big Systems</field>
<field name="parent_id" ref="analytic_partners" />
<field name="partner_id" ref="base.res_partner_2" />
<field name="plan_id" ref="analytic.analytic_plan_projects" />
</record>
<record
id="analytic.analytic_partners_camp_to_camp"
Expand All @@ -116,52 +139,64 @@
<field name="name">Camp to Camp</field>
<field name="parent_id" ref="analytic_partners" />
<field name="partner_id" ref="base.res_partner_3" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_project_2_support" model="account.analytic.account">
<field name="name">Support</field>
<field name="parent_id" ref="analytic_project_2" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_project_2_development" model="account.analytic.account">
<field name="name">Development</field>
<field name="parent_id" ref="analytic_project_2" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_project_1_trainings" model="account.analytic.account">
<field name="name">Training</field>
<field name="parent_id" ref="analytic_project_1" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_project_1_development" model="account.analytic.account">
<field name="name">Development</field>
<field name="parent_id" ref="analytic_project_1" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_administratif" model="account.analytic.account">
<field name="name">Administrative</field>
<field name="parent_id" ref="analytic.analytic_internal" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_commercial_marketing" model="account.analytic.account">
<field name="name">Commercial &amp; Marketing</field>
<field name="parent_id" ref="analytic.analytic_internal" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record
id="analytic_our_super_product_development"
model="account.analytic.account"
>
<field name="name">Our Super Product Development</field>
<field name="parent_id" ref="analytic.analytic_internal" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_stable" model="account.analytic.account">
<field name="name">Stable</field>
<field name="parent_id" ref="analytic_our_super_product_development" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_trunk" model="account.analytic.account">
<field name="name">Trunk</field>
<field name="parent_id" ref="analytic_our_super_product_development" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_paid" model="account.analytic.account">
<field name="name">Paid</field>
<field name="parent_id" ref="analytic.analytic_absences" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
<record id="analytic_unpaid" model="account.analytic.account">
<field name="name">Unpaid</field>
<field name="parent_id" ref="analytic.analytic_absences" />
<field name="plan_id" ref="analytic.analytic_plan_departments" />
</record>
</odoo>
36 changes: 31 additions & 5 deletions account_analytic_parent/tests/test_account_analytic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,46 @@ def setUp(self):
self.analytic_line_obj = self.env["account.analytic.line"]
self.partner1 = self.env.ref("base.res_partner_1")
self.partner2 = self.env.ref("base.res_partner_2")
self.plan = self.env.ref("analytic.analytic_plan_departments")
self.analytic_parent1 = self.create_analytic_account(
{"name": "parent aa", "code": "01", "partner_id": self.partner1.id}
{
"name": "parent aa",
"code": "01",
"partner_id": self.partner1.id,
"plan_id": self.plan.id,
}
)
self.analytic_son = self.create_analytic_account(
{"name": "son aa", "code": "02", "parent_id": self.analytic_parent1.id}
{
"name": "son aa",
"code": "02",
"parent_id": self.analytic_parent1.id,
"plan_id": self.plan.id,
}
)
self.analytic_parent2 = self.create_analytic_account(
{"name": "parent2 aa", "code": "01", "partner_id": self.partner2.id}
{
"name": "parent2 aa",
"code": "01",
"partner_id": self.partner2.id,
"plan_id": self.plan.id,
}
)
self.analytic_parent3 = self.create_analytic_account(
{"name": "parent3 aa", "code": "01", "partner_id": self.partner2.id}
{
"name": "parent3 aa",
"code": "01",
"partner_id": self.partner2.id,
"plan_id": self.plan.id,
}
)
self.analytic_son2 = self.create_analytic_account(
{"name": "son aa", "code": "02", "parent_id": self.analytic_parent3.id}
{
"name": "son aa",
"code": "02",
"parent_id": self.analytic_parent3.id,
"plan_id": self.plan.id,
}
)
self.create_analytic_line("Analytic line son", self.analytic_son, 50)
self.create_analytic_line("Analytic line parent1", self.analytic_parent1, 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form" />
<field name="arch" type="xml">
<field name="group_id" position="after">
<field name="plan_id" position="after">
<field name="parent_id" string="Parent Analytic Account" />
</field>
</field>
Expand Down

0 comments on commit 1911139

Please sign in to comment.