self.env['model_name'].with_context(supplier_id=1).name_of_function() # getting context values in function def name_of_function(self): supplier_id = self.env.context.get('supplier_id')