Skip to content
Snippets Groups Projects

[IMP] Added `hierarchy_level` and relations control to `res.company`

Closed Daniil Digtyar Vasilieva requested to merge IMP_company_hierarchy into 14_energy_communities

@enricostn @xavier.bonet We can assure that base.main_company will be always the instance company? This is the logic added in the post init hook.

Features

  • New hierarchy_level selector field in res.company
  • Constrains on hierarchy_level
    • Can only be one instance company
    • instance company can't have any parent_id company
    • coordinator parent hierarchy_level must be instance
    • community parent hierarchy_level must be coordinator
  • Added parent_id_filtered_ids computed field to create dynamic domain to parent_id depending on the hierarchy_level
  • Added parent_id field to easy_company_creation (Domain is not dynamic, we only create community type here)
  • Added unit test. (Feedback is appreciated :sweat_smile:)
  • Post init hook assigns instance to base.company and the children company coordinator

Roadmap

  • Enable creation of coordinator companies in easy company creation
Edited by Daniil Digtyar Vasilieva

Merge request reports

Pipeline #23561 passed

Pipeline passed for 262ca1c6 on IMP_company_hierarchy

Closed by Daniil Digtyar VasilievaDaniil Digtyar Vasilieva 1 year ago (Mar 15, 2023 10:06am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading