-
-
Notifications
You must be signed in to change notification settings - Fork 536
Description
The context is currently not kept, neither for the "main" record on which the job works, neither on the records passed in args or kwargs.
Some hints for the implementation
-
[IMP] queue: Store context in order to reuse it #121 proposed an implementation in 11.0 with an allow list
-
[13.0] Refactor storage of job records with "sudo" support #281 refactors the "main" record: the context should now be stored in the json-serialized recordsets (on records, args, kwargs) (we don't need new fields)
-
[13.0] Deprecate job decorators #274 could provide a way to customize the allowed list of keys in the context? ([IMP] queue: Store context in order to reuse it #121 (comment))
-
Add a context key in the json serializer/deserializer https://github.com/OCA/queue/blob/13.0/queue_job/fields.py
-
Pass a method to the
JobSerializedfield which does the filtering of context keysrecords = fields.JobSerialized(..., allow_list="_records_context_allow_list")
Other questions:
- should we store the context in any case?
- what should be the basis for the allow list? At least: company fields (allowed_company_ids, force_company, ... depends of the version), lang and tz?