Generic Tag: add wizard, to automatically apply tags to multiple objects via 'actions' menu
Idea
Add ability to assign tags on multiple objects. The possible solution for this, is to create wizard that will do this. Wizard have to have following fields:
- Action:
- Set Tags
- Add Tags
- Remove Tags
- Tags - list of tags for action.
It is simple to build such wizard for specific model, but we have to be able to create such wizard for all models that use generic tags
.
So, the possible way to make this wizard generic, is to relay on context, where name of models and list of ids of objects have to be present.
Thus the only thing left, is to automatically create action for tag models that will open this wizard. Such action could be generated in create
method of generic.tag.model
To Do
-
Create wizard that will change tags for specified set of models (
generic.tag.wizard.change.tags
)- Get tag model from context (
active_model
) - Get tag object ids from context (
active_ids
)
- Get tag model from context (
-
Add field
tag_change_action_id
(m2o->ir.actions.act_window
) ingeneric.tag.model
-
Add method
_create_tag_wizard_action
forgeneric.tag.model
- if
tag_change_action_id
is set, then return it - In this method create action (act_windown) that will be show in Action list on tree view on target model (tag_model)
- This action have to open wizard, passing in context active_model and active_ids for selected tag objects.
- Save created action in
tag_change_wizard_action_id
. - return create action
- if
-
Call
_create_tag_wizard_action
increate
method ofgeneric.tag.model
- Add tests for wizard
-
Add migration of old data:
- Call
_create_tag_wizard_action
in post-migrate script for all tag models.
- Call
- Add changelog entrie