Error when removing folder in scheduled action
Error when removing folder in scheduled action

When removing a directory, an error is raised on the unlinking of the
corresponding folder. It arises because of the non-null constraint on
the `folder_id` field of `oomusic.track` and `oomusic.album`.

The method `cron_scan_folder` is run by the superuser by default,
meaning that `self.env.user` is the superuser when unlinking a folder.
Therefore, the search is too restrictive since it doesn't find all
tracks and albums linked to a folder not created by a superuser.

Note that this was introduced for security, but actually an
`AccessError` will be raised anyway on the folder unlinking, preventing
any user to deleted a folder he doesn't own.

nicolasmartinelli/oomusic,DocMarty84/oomusic,nicolasmartinelli/oomusic,DocMarty84/oomusic