-
-
Notifications
You must be signed in to change notification settings - Fork 536
[13.0][IMP] queue_job current company #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use the current company to trigger the job (+ add related tests)
|
Hi @acsonefho! The addon you are improving has no declared maintainer. |
Fill allowed_company_ids from context with the job's company instead of every allowed companies of the user.
Because most of the time, a job is related to only one company. And adding every allowed companies of the user into the context may load some unexpected records (during search for example). Because standards ir.rule use ['|',('company_id','=',False),('company_id', 'in', company_ids)] and this 'company_ids' is filled with every allowed companies from the context.
113c8af to
4d43bd8
Compare
|
Shouldn't we rather design the jobs to work correctly irrespective of the user and job company_id ? |
|
Hi, maybe I don't get the use case properly, but I'm not sure to agree with:
If the job was called synchronously like a normal method, and the |
IMO if the I totally agree with the option to store the |
I do agree to store it (in the recordset as discussed in #281 (comment)), I proposed it here #283. I'm sure other people agree too, the variances of opinions may be more in what exactly in the context we allow to store or not, but we can start small with an allow-list with the standard keys. |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
I currently have some trouble to trigger
jobbecause they use the default company of the user instead of the active one.I see this open discussion: #363 but IMO using a serialized context is not in opposition with this solution as the key
allowed_company_idsis not always in the context (only if the user switch company?).I did 2 commits (IMO it's important to keep them):
allowed_company_idskey)allowed_company_idsbecause it could load too many unexpected records (during search).