Add `generic_location` addon
Idea
In simplest case location - is hierarchial structure, with only name and description. It seems to be enough for basic usage in cases like IT Service Management and maybe IT Asset Management. Also it would be good to add tags to location, thus it will be possible to attach some descriptive info to locations.
To Do
generic_location
Create addon -
Depend on
generic_mixin
mail
-
Add model
generic.location
-
inherit
-
generic.mixin.parent.names
- set model class attribute_parent_name = 'parent_id'
-mail.thread
- fields - name: Char(required, index, translatable) - description: Text(translatable) - parent_id -> m2o('generic.location', index, string='Parent Location') - active: Boolean(default=True, index) - child_ids: O2m('generic.location', 'parent_id', string='Sublocations', readonly) - child_count: Integer(computed, readonly)
- tree view - display_name - name - parent_id - active
-
form view
- display_name (as title)
- name
- parent_id
- add stat-button Archive
- Add stat-button Sublocations to display sublocations of this locations in separate list
- do not forget to pass
default_parent_id
in context - Add mail chatter integration -
search view
- name
- parent_id
- filter
Archieved
- namefilter_archieved
- stringArchieved
- domain[('active', '=', False)]
- add menu Settings / Techical Settings / Generic Locations - this is temporary place for locations menu, may be it will be moved to better place in future
-
Add following security groups for locations
- Generic Location User (implicit)
- have read-only access to locations
- Add
ir.rule
with domain - TODO, allow to see only location user is subscribed on and it's sublocations - Generic Location User - inherits Generic Location User (implicit) - have access to menu Settings / Techical Settings / Generic Locations - Generic Location Manager - inherits Generic Location User - Have all (create, read, update, delete) access rights to locations
-
inherit
-
generic_location_tag
Create addon -
Depend on
generic_location
generic_tag
-
Create data record to model
generic.tag.model
model_id = ref('generic_location.model_generic_location')
-
Modify model
generic.location
- inherit
generic.tag.mixin
-
Modify location search view
- add field
tag_ids
- add fieldsearch_tag_id
- add fieldsearch_no_tag_id
-
Modify location tree view
- add field
tag_ids
- widget:many2many_tags
-
Modify location form view
- add field
tag_ids
- widget:many2many_tags
- context:{'default_model': 'generic.location'}
- inherit
-
Add menuitem Tags / Generic Location Tags / Generic Location Tags
- open tree view with available tags for Generic Locations
- See example in
generic_tag_*
addons