Environment swapping is most important for odoo module and with_context([context][, **overrides])
records[source]
It Returns a new version of this recordset attached to an extended context.
The extended context is either the provided context in which overrides are merged or the current context in which overrides are merged e.g.:
# current context is {'key1': True}
r2 = records.with_context({}, key2=True)
# -> r2._context is {'key2': True}
r2 = records.with_context(key2=True)
# -> r2._context is {'key1': True, 'key2': True}
Note-Returns a new version of this recordset attached to the provided environment
0 Comment(s)