I don’t know if this is possible at all. Maybe with the new
Model.__access in Tryton 6.0? But I have a situation as shown in de diagram:
It’s all about the Tasks model, mainly to give the user just the tasks needed for doing the work, but also prevent partly scraping of data (which becomes more and more lucrative because data is the new oil).
So there are basically three access points to the Tasks model:
- An employee can directly access the model and get only the tasks assigned to him
- An employee can see the workorder if he is in the list of
employees, but the workorder has a
One2Manyrelation with the tasks model. The employee in this case is allowed to see all the tasks which are linked to that workorder
- An employee can see equipment. Like the workorder the equipment has also an
One2Manyrelation to the tasks model, just to get an history of work done on the equipment.
At the moment point 1 is implemented with a record rule, but it prevents the other points from working. Is this something which can be done? I was thinking of having the ‘entry’ model (equipment or workorder) in the record rule and based on that make the decision to give access or not. When that would be possible it’s becoming a very simple if statement:
If ‘entry’ model is Tasks, filter the the tasks. Else show the tasks.
In short: Is this possible or are there other ways to get it working?