Generic Condition: Additional checks for current user
Idea
Add following checks
- Check if current user is one of a list
- Apply list of conditions to current user
To Do
-
Add field
condition_user_check_type
: selection, track_visibility=onchange- Field (field)
- if selected
condition_user_user_field_id
is required and visible, otherwise invisible
- if selected
- One of (one_of)
- if selected
condition_user_user_ids
is required and visible, otherwise invisible
- if selected
- Checks (checks)
- if selected
condition_user_condition_ids
is required and visible, otherwise invisible
- if selected
- Field (field)
-
Add field
condition_user_user_ids
many2many (res.users)- track visibility onchange
-
Add field
condition_user_condition_ids
many2many (generic.condition)- specify relation table
- track visibility onchange
- domain: [('based_on', '=', 'res.users')]
- in view, pass
'default_based_on': 'res.users'
in context
-
Use following lay out in view:
<condition_user_check_type> <condition_user_user_field_id or condition_user_user_ids or condition_user_condition_ids>
- Add tests for both cases