queue
queue copied to clipboard
14.0 Setting Company id in jobs question
https://github.com/OCA/queue/blob/911b995e66c2d550826d1ce9ea4e18ef97ae6dc4/queue_job/job.py#L499-L502
We have this code here but it is constantly causing me issues in v14 with AccessErrors if I perform a function on a record in a different company to the one I am presently primarily logged into.
env.company often has no relation to the record being actioned. I feel like we should be defaulting to the company of the record second, then taking the users current company. Or is it just me getting these problems.
I agree w/ getting the default from the recordset company if available.
I think we should drop this company_id field from jobs. It was a mistake when we added that.
What are the implications of dropping it? So many functions in Odoo required the company to be set to get correct results, yet many many functions are naive and overlook this, just getting the company of current user.
I know the issues with keeping it as well, just not sure how we can resolve both sides.
Dropping it would create multi company issues as we use this to separate jobs between multiple companies.
Not everyone should be able to see jobs from other companies. We also use this company_id field to execute some jobs in the correct company context.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.
We currently get around this by introducing a 'bot' (inactive) user per company. Jobs are placed onto the queue using the per-company bot-user.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.