If you need to modifiy your current context you may use the with_context() function.
self.env['res.partner'].with_context(tz=x).create(vals)
Be careful not to modify current RecordSet using this functionality:
self = self.env['res.partner'].with_context(tz=x).browse(self.ids)
Note- It will modifiy the current Records in RecordSet after a rebrowse and will generate an incoherence between caches and RecordSet.
0 Comment(s)