Some buttons are approbations and in some cases we need to have clicks of multiple users. Such multiple clicks can require click from a specific group or click from a number of user. Also they can depend on the record approved (ex: amount of the purchase). And this is configuration specific to the company rules so it must be configurable from the interface.
We could extend the
ir.model.button to contain a list of rules. Each rule is a constraint that must be passed.
We extend the
ModelView.button decorator to record who has clicked on the button and to check all approbation rules. The decorator will filter out all records that does not pass the rules from the super call.
The rule will be composed of a group, a number (of user) and a condition (PYSON). It will also have a list of buttons that will clear the “click” if clicked.
The “click” will just record the user.
- Add “clicked by me” Function field to use as filter